You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/06/30 03:15:06 UTC

[incubator-servicecomb-java-chassis] 03/03: add some unit tests

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

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 060af8d66c61cc714e1b1a11e043a56f0dae9264
Author: f00240441 <qi...@huawei.com>
AuthorDate: Wed Jun 27 19:18:32 2018 +0800

    add some unit tests
---
 .../serviceregistry/client/LocalServiceRegistryClientImplTest.java | 7 +++++++
 service-registry/src/test/resources/registry.yaml                  | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImplTest.java b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImplTest.java
index 095aa8b..7e95be9 100644
--- a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImplTest.java
+++ b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImplTest.java
@@ -190,5 +190,12 @@ public class LocalServiceRegistryClientImplTest {
     Assert.assertEquals(200, schemasHolder.getStatusCode());
     Assert.assertTrue(schemasHolder.getValue().isEmpty());
   }
+
+  @Test
+  public void testLoadSchemaIdsFromRegistryFile() {
+    Microservice microservice = registryClient.getMicroservice("001");
+    Assert.assertThat(microservice.getSchemas().size(), Is.is(1));
+    Assert.assertTrue(microservice.getSchemas().contains("springmvcHello"));
+  }
 }
 
diff --git a/service-registry/src/test/resources/registry.yaml b/service-registry/src/test/resources/registry.yaml
index ffd495c..8cad52c 100644
--- a/service-registry/src/test/resources/registry.yaml
+++ b/service-registry/src/test/resources/registry.yaml
@@ -19,6 +19,8 @@ springmvctest:
   - id: "001"
     version: "1.0"
     appid: myapp
+    schemaIds:
+      - springmvcHello
     instances:
       - endpoints:
         - rest://127.0.0.1:8080