oceanbase

Форк
0
/
ob_rootservice_info_test.go 
42 строки · 1.1 Кб
1
/**
2
 * Copyright (c) 2021 OceanBase
3
 * OceanBase CE is licensed under Mulan PubL v2.
4
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
5
 * You may obtain a copy of Mulan PubL v2 at:
6
 *          http://license.coscl.org.cn/MulanPubL-2.0
7
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10
 * See the Mulan PubL v2 for more details.
11
 */
12

13
package model
14

15
import (
16
	"github.com/stretchr/testify/require"
17
	"testing"
18
)
19

20
type Service struct {
21
	Address string `json:"address"`
22
}
23

24
func TestFillObRegion(t *testing.T) {
25
	info := &ObRootServiceInfo{
26
		ObCluster:   "helloworld",
27
		ObClusterId: 1,
28
	}
29
	info.Fill()
30
	require.Equal(t, int64(1), info.ObRegionId)
31
	require.Equal(t, "helloworld", info.ObRegion)
32
}
33

34
func TestFillObCluster(t *testing.T) {
35
	info := &ObRootServiceInfo{
36
		ObRegion:   "helloworld",
37
		ObRegionId: 1,
38
	}
39
	info.Fill()
40
	require.Equal(t, int64(1), info.ObClusterId)
41
	require.Equal(t, "helloworld", info.ObCluster)
42
}
43

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.