test_class.declarator: modulesService
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private ModulesService modulesService;
test_class.type: ModulesService
test_class.var_name: modulesService
test_class.declarator: discoveryClient
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private EurekaClient discoveryClient;
test_class.type: EurekaClient
test_class.var_name: discoveryClient
test_class.declarator: discoveryUtils
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private DiscoveryUtils discoveryUtils;
test_class.type: DiscoveryUtils
test_class.var_name: discoveryUtils
test_class.declarator: instanceInfo
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private InstanceInfo instanceInfo;
test_class.type: InstanceInfo
test_class.var_name: instanceInfo
test_class.declarator: application
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Application application;
test_class.type: Application
test_class.var_name: application
test_class.declarator: wireMockRule = new WireMockRule(8089)
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public WireMockRule wireMockRule = new WireMockRule(8089);
test_class.type: WireMockRule
test_class.var_name: wireMockRule
test_class.file: api-gateway/src/test/java/fr/sictiam/stela/apigateway/service/ModulesServiceTest.java
test_class.identifier: ModulesServiceTest
test_case.body: @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);
      }
test_case.class_method_signature: ModulesServiceTest.moduleHaveInstance()
test_case.full_signature: @Test public void moduleHaveInstance()
test_case.identifier: moduleHaveInstance
test_case.invocations: setField add willReturn given getApplication matches willReturn given getInstances moduleHaveInstance assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void moduleHaveInstance()
focal_class.declarator: discoveryClient
focal_class.modifier: private final
focal_class.original_string: private final EurekaClient discoveryClient;
focal_class.type: EurekaClient
focal_class.var_name: discoveryClient
focal_class.file: api-gateway/src/main/java/fr/sictiam/stela/apigateway/service/ModulesService.java
focal_class.identifier: ModulesService
focal_class.class_method_signature: ModulesService.ModulesService(EurekaClient discoveryClient)
focal_class.full_signature: public  ModulesService(EurekaClient discoveryClient)
focal_class.identifier: ModulesService
focal_class.modifiers: public
focal_class.parameters: (EurekaClient discoveryClient)
focal_class.signature:  ModulesService(EurekaClient discoveryClient)
focal_class.class_method_signature: ModulesService.moduleHaveInstance(String moduleName)
focal_class.full_signature: public boolean moduleHaveInstance(String moduleName)
focal_class.identifier: moduleHaveInstance
focal_class.modifiers: public
focal_class.parameters: (String moduleName)
focal_class.return: boolean
focal_class.signature: boolean moduleHaveInstance(String moduleName)
focal_class.class_method_signature: ModulesService.activeBusinessApplications()
focal_class.full_signature: public List<Application> activeBusinessApplications()
focal_class.identifier: activeBusinessApplications
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<Application>
focal_class.signature: List<Application> activeBusinessApplications()
focal_class.class_method_signature: ModulesService.extractServiceName(String serviceName)
focal_class.full_signature: public String extractServiceName(String serviceName)
focal_class.identifier: extractServiceName
focal_class.modifiers: public
focal_class.parameters: (String serviceName)
focal_class.return: String
focal_class.signature: String extractServiceName(String serviceName)
focal_method.body: public boolean moduleHaveInstance(String moduleName) {
          Application application = discoveryClient.getApplication(moduleName.concat("-service").toUpperCase());
          return application != null && !application.getInstances().isEmpty();
      }
focal_method.class_method_signature: ModulesService.moduleHaveInstance(String moduleName)
focal_method.full_signature: public boolean moduleHaveInstance(String moduleName)
focal_method.identifier: moduleHaveInstance
focal_method.invocations: getApplication toUpperCase concat isEmpty getInstances
focal_method.modifiers: public
focal_method.parameters: (String moduleName)
focal_method.return: boolean
focal_method.signature: boolean moduleHaveInstance(String moduleName)