maheshrajus commented on a change in pull request #801: [SCB-727] Local 
generated schema and service center schema are different then print the diff 
content to the user
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/801#discussion_r202050121
 
 

 ##########
 File path: 
service-registry/src/test/java/org/apache/servicecomb/serviceregistry/task/TestMicroserviceRegisterTask.java
 ##########
 @@ -498,12 +508,36 @@ public void 
testLocalSchemaAndServiceCenterSchemaDiff(@Mocked ServiceRegistryCli
         result = otherMicroservice;
         srClient.getSchemas(anyString);
         result = onlineSchemasHolder;
+        srClient.getSchema(anyString, anyString);
+        result = "abcdefghijklmn";
       }
     };
 
-    microservice.addSchema("s1", "abdc");
+    microservice.addSchema("s1", "abcdefghijklmnopqrstuvwxyz");
     microservice.setEnvironment("prod");
     MicroserviceRegisterTask registerTask = new 
MicroserviceRegisterTask(eventBus, srClient, microservice);
-    registerTask.run();
+
+    Logger logger = Logger.getLogger(MicroserviceRegisterTask.class);
+    ByteArrayOutputStream out = new ByteArrayOutputStream();
+    Layout layout = new SimpleLayout();
+    Appender appender = new WriterAppender(layout, out);
+    logger.addAppender(appender);
+    Boolean isIlleagalException = false;
+
+    try {
+      registerTask.run();
+    } catch (IllegalStateException exception) {
+      isIlleagalException = true;
+      String logMsg = out.toString();
+      assertNotNull(logMsg);
+      Assert.assertTrue(logMsg.contains("service center schema:"));
 
 Review comment:
   OK

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to