test_class.declarator: rightsService
test_class.modifier: @SpyBean
      private
test_class.original_string: @SpyBean
      private RightsService rightsService;
test_class.type: RightsService
test_class.var_name: rightsService
test_class.declarator: modulesService
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private ModulesService modulesService;
test_class.type: ModulesService
test_class.var_name: modulesService
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: 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: 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: instanceInfo1
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private InstanceInfo instanceInfo1;
test_class.type: InstanceInfo
test_class.var_name: instanceInfo1
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/RightsServiceTest.java
test_class.identifier: RightsServiceTest
test_case.body: @Test
      public void getRightsWithoutPESModuleInstance() {
          InstanceInfo instanceInfoActe = this.instanceInfo("acte", "acte-service", "BUSINESS");
          InstanceInfo instanceInfoConvocation = this.instanceInfo("convocation", "convocation-service", "BUSINESS");
  
          Application applicationActe = this.application(instanceInfoActe, "acte-service");
          Application applicationConvocation = this.application(instanceInfoConvocation, "convocation-service");
  
  
          List<Application> applications = new ArrayList<>();
  
          applications.add(applicationActe);
          applications.add(applicationConvocation);
  
          given(modulesService.activeBusinessApplications()).willReturn(applications);
  
          List<String> rights = rightsService.getRights();
  
          WireMock.verify(2, getRequestedFor(urlPathMatching("/api/(acte|convocation)/rights")));
  
          Assert.assertEquals(5, rights.size());
      }
test_case.class_method_signature: RightsServiceTest.getRightsWithoutPESModuleInstance()
test_case.full_signature: @Test public void getRightsWithoutPESModuleInstance()
test_case.identifier: getRightsWithoutPESModuleInstance
test_case.invocations: instanceInfo instanceInfo application application add add willReturn given activeBusinessApplications getRights verify getRequestedFor urlPathMatching assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getRightsWithoutPESModuleInstance()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(RightsService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(RightsService.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: restTemplate
focal_class.modifier: private final
focal_class.original_string: private final RestTemplate restTemplate;
focal_class.type: RestTemplate
focal_class.var_name: restTemplate
focal_class.declarator: discoveryUtils
focal_class.modifier: private final
focal_class.original_string: private final DiscoveryUtils discoveryUtils;
focal_class.type: DiscoveryUtils
focal_class.var_name: discoveryUtils
focal_class.declarator: modulesService
focal_class.modifier: private final
focal_class.original_string: private final ModulesService modulesService;
focal_class.type: ModulesService
focal_class.var_name: modulesService
focal_class.file: api-gateway/src/main/java/fr/sictiam/stela/apigateway/service/RightsService.java
focal_class.identifier: RightsService
focal_class.class_method_signature: RightsService.RightsService(RestTemplateBuilder builder, ModulesService modulesService, DiscoveryUtils discoveryUtils)
focal_class.full_signature: @Autowired public  RightsService(RestTemplateBuilder builder, ModulesService modulesService, DiscoveryUtils discoveryUtils)
focal_class.identifier: RightsService
focal_class.modifiers: @Autowired public
focal_class.parameters: (RestTemplateBuilder builder, ModulesService modulesService, DiscoveryUtils discoveryUtils)
focal_class.signature:  RightsService(RestTemplateBuilder builder, ModulesService modulesService, DiscoveryUtils discoveryUtils)
focal_class.class_method_signature: RightsService.getRights()
focal_class.full_signature: public List<String> getRights()
focal_class.identifier: getRights
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<String>
focal_class.signature: List<String> getRights()
focal_class.class_method_signature: RightsService.buildRightsEndpointUrl(String applicationName)
focal_class.full_signature: private String buildRightsEndpointUrl(String applicationName)
focal_class.identifier: buildRightsEndpointUrl
focal_class.modifiers: private
focal_class.parameters: (String applicationName)
focal_class.return: String
focal_class.signature: String buildRightsEndpointUrl(String applicationName)
focal_method.body: public List<String> getRights() {
          List<String> rights = new ArrayList<>();
  
          modulesService.activeBusinessApplications().forEach(application -> {
              InstanceInfo instanceInfo = application.getInstances().get(0);
              String serviceName = modulesService.extractServiceName(application.getName());
              try {
                  String[] response =
                          restTemplate.getForObject(this.buildRightsEndpointUrl(serviceName), String[].class);
                  rights.addAll(Arrays.asList(Objects.requireNonNull(response)));
              } catch(RestClientException e) {
                  LOGGER.warn("[getRights] An error occured in module {} : {}", application.getName(), e.getMessage());
              }
          });
  
          return rights;
      }
focal_method.class_method_signature: RightsService.getRights()
focal_method.full_signature: public List<String> getRights()
focal_method.identifier: getRights
focal_method.invocations: forEach activeBusinessApplications get getInstances extractServiceName getName getForObject buildRightsEndpointUrl addAll asList requireNonNull warn getName getMessage
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: List<String>
focal_method.signature: List<String> getRights()