You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2021/05/17 06:17:28 UTC

[shardingsphere] branch master updated: Add test case for RegistryCenterRepositoryFactory (#10356)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 36fc67f  Add test case for RegistryCenterRepositoryFactory (#10356)
36fc67f is described below

commit 36fc67f0f1d5cd9de5531cd5f0bb10afe08b34b2
Author: totalo <48...@qq.com>
AuthorDate: Mon May 17 14:16:47 2021 +0800

    Add test case for RegistryCenterRepositoryFactory (#10356)
    
    * add RegistryCenterRepositoryFactoryTest
    
    * add license
---
 .../RegistryCenterRepositoryFactoryTest.java       | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/shardingsphere-governance/shardingsphere-governance-core/src/test/java/org/apache/shardingsphere/governance/core/facade/RegistryCenterRepositoryFactoryTest.java b/shardingsphere-governance/shardingsphere-governance-core/src/test/java/org/apache/shardingsphere/governance/core/facade/RegistryCenterRepositoryFactoryTest.java
new file mode 100644
index 0000000..2066b27
--- /dev/null
+++ b/shardingsphere-governance/shardingsphere-governance-core/src/test/java/org/apache/shardingsphere/governance/core/facade/RegistryCenterRepositoryFactoryTest.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.governance.core.facade;
+
+import org.apache.shardingsphere.governance.repository.api.config.GovernanceConfiguration;
+import org.apache.shardingsphere.governance.repository.api.config.RegistryCenterConfiguration;
+import org.apache.shardingsphere.governance.repository.spi.RegistryCenterRepository;
+import org.junit.Test;
+
+import java.util.Properties;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public final class RegistryCenterRepositoryFactoryTest {
+
+    @Test
+    public void assertNewInstance() {
+        GovernanceConfiguration config = new GovernanceConfiguration("test_name", new RegistryCenterConfiguration("TEST", "127.0.0.1", new Properties()), false);
+        RegistryCenterRepository registryCenterRepository = RegistryCenterRepositoryFactory.newInstance(config);
+        assertNotNull(registryCenterRepository);
+        assertEquals("TEST", registryCenterRepository.getType());
+    }
+}