@Test public void moduleHaveInstance() { ReflectionTestUtils.setField(this.instanceInfo, "appName", "pes-service"); List<InstanceInfo> instances = new ArrayList<>(); instances.add(this.instanceInfo); given(discoveryClient.getApplication(matches("PES-SERVICE"))).willReturn(application); given(application.getInstances()).willReturn(instances); boolean moduleHaveInstance = modulesService.moduleHaveInstance("pes"); Assert.assertTrue(moduleHaveInstance); }
public boolean moduleHaveInstance(String moduleName) { Application application = discoveryClient.getApplication(moduleName.concat("-service").toUpperCase()); return application != null && !application.getInstances().isEmpty(); }
ModulesService { public boolean moduleHaveInstance(String moduleName) { Application application = discoveryClient.getApplication(moduleName.concat("-service").toUpperCase()); return application != null && !application.getInstances().isEmpty(); } }
ModulesService { public boolean moduleHaveInstance(String moduleName) { Application application = discoveryClient.getApplication(moduleName.concat("-service").toUpperCase()); return application != null && !application.getInstances().isEmpty(); } ModulesService(EurekaClient discoveryClient); }
ModulesService { public boolean moduleHaveInstance(String moduleName) { Application application = discoveryClient.getApplication(moduleName.concat("-service").toUpperCase()); return application != null && !application.getInstances().isEmpty(); } ModulesService(EurekaClient discoveryClient); boolean moduleHaveInstance(String moduleName); List<Application> activeBusinessApplications(); String extractServiceName(String serviceName); }
ModulesService { public boolean moduleHaveInstance(String moduleName) { Application application = discoveryClient.getApplication(moduleName.concat("-service").toUpperCase()); return application != null && !application.getInstances().isEmpty(); } ModulesService(EurekaClient discoveryClient); boolean moduleHaveInstance(String moduleName); List<Application> activeBusinessApplications(); String extractServiceName(String serviceName);  }