myrle-krantz commented on issue #3: Docker infrastructure for Eureka and 
ActiveMQ
URL: 
https://github.com/apache/fineract-cn-demo-server/pull/3#issuecomment-379678926
 
 
   Hey Viswa,
   
   The DiscoveryClient is used by the demo-server to wait until a service is 
"up".  We poll at increasing intervals until we see that the service in 
question is registered with Eureka.  It's a more reliable way to wait until a 
service is up than just guessing how long it will take and programming purely 
with fixed length sleeps.  The relevant line can be found here: 
https://github.com/apache/fineract-cn-demo-server/blob/develop/src/main/java/io/mifos/dev/ServiceRunner.java#L298
   
   As to what I'm looking for with respect to the test rules:  I've programmed 
it out for you so that you can see it.  Here:
   ```
     public static final ExternalResource EUREKA_FOR_TEST = new 
RunExternalResourceConditionally(
         new EurekaForTest(),
         System.getProperty("external.infrastructure") == null);
   ```
   You'll have to pull fineract-cn-test because that's where I added the 
"RunExternalResourceConditionally" test rule.
   
   If you're looking for general information about the useage of TestRules and 
ExternalResources in junit, here's a good tutorial: 
https://carlosbecker.com/posts/junit-rules/
   
   Best Regards,
   Myrle

----------------------------------------------------------------
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