test_class.declarator: externalRestService
test_class.modifier: @SpyBean
      private
test_class.original_string: @SpyBean
      private ExternalRestService externalRestService;
test_class.type: ExternalRestService
test_class.var_name: externalRestService
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: restTemplate
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private RestTemplate restTemplate;
test_class.type: RestTemplate
test_class.var_name: restTemplate
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: acte-service/src/test/java/fr/sictiam/stela/acteservice/service/ExternalRestServiceTest.java
test_class.identifier: ExternalRestServiceTest
test_case.body: @Test
      public void getDcIdFromKernelLocalAuthorityNotFound() {
          stubFor(get(urlPathEqualTo("/api/admin/local-authority/987654321/dcId"))
                  .willReturn(notFound()));
  
          LocalAuthority localAuthority = new LocalAuthority();
          ReflectionTestUtils.setField(localAuthority, "uuid", "uuid-local-authority-two-test");
          localAuthority.setSiren("987654321");
  
          Optional<String> dcId = externalRestService.getLocalAuthorityDcId(localAuthority);
  
          WireMock.verify(getRequestedFor(urlPathEqualTo("/api/admin/local-authority/987654321/dcId")));
          Assert.assertFalse(dcId.isPresent());
      }
test_case.class_method_signature: ExternalRestServiceTest.getDcIdFromKernelLocalAuthorityNotFound()
test_case.full_signature: @Test public void getDcIdFromKernelLocalAuthorityNotFound()
test_case.identifier: getDcIdFromKernelLocalAuthorityNotFound
test_case.invocations: stubFor willReturn get urlPathEqualTo notFound setField setSiren getLocalAuthorityDcId verify getRequestedFor urlPathEqualTo assertFalse isPresent
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getDcIdFromKernelLocalAuthorityNotFound()
focal_class.declarator: discoveryUtils
focal_class.modifier: @Autowired
focal_class.original_string: @Autowired
      DiscoveryUtils discoveryUtils;
focal_class.type: DiscoveryUtils
focal_class.var_name: discoveryUtils
focal_class.declarator: LOGGER = LoggerFactory.getLogger(ExternalRestService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(ExternalRestService.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: acte-service/src/main/java/fr/sictiam/stela/acteservice/service/ExternalRestService.java
focal_class.identifier: ExternalRestService
focal_class.class_method_signature: ExternalRestService.getProfile(String profileUuid)
focal_class.full_signature: public JsonNode getProfile(String profileUuid)
focal_class.identifier: getProfile
focal_class.modifiers: public
focal_class.parameters: (String profileUuid)
focal_class.return: JsonNode
focal_class.signature: JsonNode getProfile(String profileUuid)
focal_class.class_method_signature: ExternalRestService.getProfileForEmail(String siren, String email)
focal_class.full_signature: public JsonNode getProfileForEmail(String siren, String email)
focal_class.identifier: getProfileForEmail
focal_class.modifiers: public
focal_class.parameters: (String siren, String email)
focal_class.return: JsonNode
focal_class.signature: JsonNode getProfileForEmail(String siren, String email)
focal_class.class_method_signature: ExternalRestService.getGroupsForLocalAuthority(String uuid)
focal_class.full_signature: public JsonNode getGroupsForLocalAuthority(String uuid)
focal_class.identifier: getGroupsForLocalAuthority
focal_class.modifiers: public
focal_class.parameters: (String uuid)
focal_class.return: JsonNode
focal_class.signature: JsonNode getGroupsForLocalAuthority(String uuid)
focal_class.class_method_signature: ExternalRestService.getProfiles(String uuid)
focal_class.full_signature: public JsonNode getProfiles(String uuid)
focal_class.identifier: getProfiles
focal_class.modifiers: public
focal_class.parameters: (String uuid)
focal_class.return: JsonNode
focal_class.signature: JsonNode getProfiles(String uuid)
focal_class.class_method_signature: ExternalRestService.getGenericAccount(String uuid)
focal_class.full_signature: public GenericAccount getGenericAccount(String uuid)
focal_class.identifier: getGenericAccount
focal_class.modifiers: public
focal_class.parameters: (String uuid)
focal_class.return: GenericAccount
focal_class.signature: GenericAccount getGenericAccount(String uuid)
focal_class.class_method_signature: ExternalRestService.authWithCertificate(String serial, String vendor)
focal_class.full_signature: public GenericAccount authWithCertificate(String serial, String vendor)
focal_class.identifier: authWithCertificate
focal_class.modifiers: public
focal_class.parameters: (String serial, String vendor)
focal_class.return: GenericAccount
focal_class.signature: GenericAccount authWithCertificate(String serial, String vendor)
focal_class.class_method_signature: ExternalRestService.authWithEmailPassword(String email, String password)
focal_class.full_signature: public GenericAccount authWithEmailPassword(String email, String password)
focal_class.identifier: authWithEmailPassword
focal_class.modifiers: public
focal_class.parameters: (String email, String password)
focal_class.return: GenericAccount
focal_class.signature: GenericAccount authWithEmailPassword(String email, String password)
focal_class.class_method_signature: ExternalRestService.getPaullConnection(String sessionID)
focal_class.full_signature: public JsonNode getPaullConnection(String sessionID)
focal_class.identifier: getPaullConnection
focal_class.modifiers: public
focal_class.parameters: (String sessionID)
focal_class.return: JsonNode
focal_class.signature: JsonNode getPaullConnection(String sessionID)
focal_class.class_method_signature: ExternalRestService.getLocalAuthorityByCertificate(Certificate certificate)
focal_class.full_signature: public LocalAuthority getLocalAuthorityByCertificate(Certificate certificate)
focal_class.identifier: getLocalAuthorityByCertificate
focal_class.modifiers: public
focal_class.parameters: (Certificate certificate)
focal_class.return: LocalAuthority
focal_class.signature: LocalAuthority getLocalAuthorityByCertificate(Certificate certificate)
focal_class.class_method_signature: ExternalRestService.createGroup(LocalAuthority localAuthority, String name)
focal_class.full_signature: public String createGroup(LocalAuthority localAuthority, String name)
focal_class.identifier: createGroup
focal_class.modifiers: public
focal_class.parameters: (LocalAuthority localAuthority, String name)
focal_class.return: String
focal_class.signature: String createGroup(LocalAuthority localAuthority, String name)
focal_class.class_method_signature: ExternalRestService.getAccessTokenFromKernel(LocalAuthority localAuthority)
focal_class.full_signature: public Optional<String> getAccessTokenFromKernel(LocalAuthority localAuthority)
focal_class.identifier: getAccessTokenFromKernel
focal_class.modifiers: public
focal_class.parameters: (LocalAuthority localAuthority)
focal_class.return: Optional<String>
focal_class.signature: Optional<String> getAccessTokenFromKernel(LocalAuthority localAuthority)
focal_class.class_method_signature: ExternalRestService.getLocalAuthorityDcId(LocalAuthority localAuthority)
focal_class.full_signature: public Optional<String> getLocalAuthorityDcId(LocalAuthority localAuthority)
focal_class.identifier: getLocalAuthorityDcId
focal_class.modifiers: public
focal_class.parameters: (LocalAuthority localAuthority)
focal_class.return: Optional<String>
focal_class.signature: Optional<String> getLocalAuthorityDcId(LocalAuthority localAuthority)
focal_class.class_method_signature: ExternalRestService.getProfileByLocalAuthoritySirenAndEmail(String siren, String email)
focal_class.full_signature: public JsonNode getProfileByLocalAuthoritySirenAndEmail(String siren, String email)
focal_class.identifier: getProfileByLocalAuthoritySirenAndEmail
focal_class.modifiers: public
focal_class.parameters: (String siren, String email)
focal_class.return: JsonNode
focal_class.signature: JsonNode getProfileByLocalAuthoritySirenAndEmail(String siren, String email)
focal_method.body: public Optional<String> getLocalAuthorityDcId(LocalAuthority localAuthority) {
          RestTemplate restTemplate = new RestTemplate();
  
          try {
              String dcId = restTemplate.getForObject(
                      discoveryUtils.adminServiceUrl() + "/api/admin/local-authority/{localAuthoritySiren}/dcId",
                      String.class,
                      localAuthority.getSiren());
              return Optional.ofNullable(dcId);
          } catch (RestClientResponseException e){
              LOGGER.error(
                      "[getLocalAuthorityDcId] An error was occured when tried to get DcId for organization {} from {} : Status {} Body {} ",
                      localAuthority.getSiren(),
                      discoveryUtils.adminServiceUrl(),
                      e.getRawStatusCode(),
                      e.getResponseBodyAsString());
              return Optional.empty();
          }
      }
focal_method.class_method_signature: ExternalRestService.getLocalAuthorityDcId(LocalAuthority localAuthority)
focal_method.full_signature: public Optional<String> getLocalAuthorityDcId(LocalAuthority localAuthority)
focal_method.identifier: getLocalAuthorityDcId
focal_method.invocations: getForObject adminServiceUrl getSiren ofNullable error getSiren adminServiceUrl getRawStatusCode getResponseBodyAsString empty
focal_method.modifiers: public
focal_method.parameters: (LocalAuthority localAuthority)
focal_method.return: Optional<String>
focal_method.signature: Optional<String> getLocalAuthorityDcId(LocalAuthority localAuthority)