Skip to content

Commit

Permalink
fix(alibaba#11930): the information of default namespace should be co…
Browse files Browse the repository at this point in the history
…nsistent.

fix(alibaba#11930): the information of default namespace should be consistent.
  • Loading branch information
Bo-Qiu committed Nov 4, 2024
1 parent e2d44f2 commit f7943af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@
public class NamespaceOperationService {

private final NamespacePersistService namespacePersistService;

private static final String DEFAULT_NAMESPACE_SHOW_NAME = "public";

private static final String DEFAULT_NAMESPACE = "public";

private static final String DEFAULT_NAMESPACE_SHOW_NAME = "Public";

private static final String DEFAULT_NAMESPACE_DESCRIPTION = "Public Namespace";
private static final String DEFAULT_NAMESPACE_DESCRIPTION = "Default Namespace";

private static final int DEFAULT_QUOTA = 200;

Expand All @@ -64,8 +62,8 @@ public List<Namespace> getNamespaceList() {
// TODO 获取用kp
List<TenantInfo> tenantInfos = namespacePersistService.findTenantByKp(DEFAULT_KP);

Namespace namespace0 = new Namespace(NamespaceUtil.getNamespaceDefaultId(), DEFAULT_NAMESPACE, DEFAULT_QUOTA, 0,
NamespaceTypeEnum.GLOBAL.getType());
Namespace namespace0 = new Namespace(NamespaceUtil.getNamespaceDefaultId(), DEFAULT_NAMESPACE_SHOW_NAME,
DEFAULT_NAMESPACE_DESCRIPTION, DEFAULT_QUOTA, 0, NamespaceTypeEnum.GLOBAL.getType());
NamespaceDetailInjectorHolder.getInstance().injectDetail(namespace0);
List<Namespace> namespaceList = new ArrayList<>();
namespaceList.add(namespace0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class NamespaceOperationServiceTest {

private static final String TEST_NAMESPACE_DESC = "testDesc";

private static final String DEFAULT_NAMESPACE = "public";
private static final String DEFAULT_NAMESPACE_SHOW_NAME = "public";

private static final String DEFAULT_NAMESPACE_DESCRIPTION = "Default NamespaceK";

private static final int DEFAULT_QUOTA = 200;

Expand Down Expand Up @@ -93,7 +95,8 @@ void testGetNamespaceList() {
assertEquals(2, list.size());
Namespace namespaceA = list.get(0);
assertEquals("", namespaceA.getNamespace());
assertEquals(DEFAULT_NAMESPACE, namespaceA.getNamespaceShowName());
assertEquals(DEFAULT_NAMESPACE_SHOW_NAME, namespaceA.getNamespaceShowName());
assertEquals(DEFAULT_NAMESPACE_DESCRIPTION, namespaceA.getNamespaceDesc());
assertEquals(DEFAULT_QUOTA, namespaceA.getQuota());
assertEquals(1, namespaceA.getConfigCount());

Expand All @@ -104,7 +107,7 @@ void testGetNamespaceList() {
}

@Test
void testGetNamespace() throws NacosException {
void testGetNamespace() {
assertThrows(NacosApiException.class, () -> {

TenantInfo tenantInfo = new TenantInfo();
Expand Down

0 comments on commit f7943af

Please sign in to comment.