test_class.declarator: dcImporterService
test_class.modifier: @SpyBean
      private
test_class.original_string: @SpyBean
      private DcImporterService dcImporterService;
test_class.type: DcImporterService
test_class.var_name: dcImporterService
test_class.declarator: externalRestService
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private ExternalRestService externalRestService;
test_class.type: ExternalRestService
test_class.var_name: externalRestService
test_class.declarator: localAuthorityService
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private LocalAuthorityService localAuthorityService;
test_class.type: LocalAuthorityService
test_class.var_name: localAuthorityService
test_class.declarator: acteService
test_class.modifier: @MockBean
      private
test_class.original_string: @MockBean
      private ActeService acteService;
test_class.type: ActeService
test_class.var_name: acteService
test_class.declarator: wireMockRule = new WireMockRule(8089)
test_class.modifier: @ClassRule
      static public
test_class.original_string: @ClassRule
      static 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/DcImporterServiceTest.java
test_class.identifier: DcImporterServiceTest
test_case.body: @Test
      public void getAccessTokenForDataOwner() {
          LocalAuthority localAuthority = new LocalAuthority();
          ReflectionTestUtils.setField(localAuthority, "uuid", "uuid-local-authority-one-test");
  
          given(localAuthorityService.getBySiren("123456789")).willReturn(Optional.of(localAuthority));
          given(externalRestService.getAccessTokenFromKernel(any())).willReturn(Optional.of("access-token"));
  
          Optional<String> accessToken = dcImporterService.getAccessTokenForDataOwner();
  
          Assert.assertTrue(accessToken.isPresent());
      }
test_case.class_method_signature: DcImporterServiceTest.getAccessTokenForDataOwner()
test_case.full_signature: @Test public void getAccessTokenForDataOwner()
test_case.identifier: getAccessTokenForDataOwner
test_case.invocations: setField willReturn given getBySiren of willReturn given getAccessTokenFromKernel any of getAccessTokenForDataOwner assertTrue isPresent
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getAccessTokenForDataOwner()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(DcImporterService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(DcImporterService.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: externalRestService
focal_class.modifier: private
focal_class.original_string: private ExternalRestService externalRestService;
focal_class.type: ExternalRestService
focal_class.var_name: externalRestService
focal_class.declarator: localAuthorityService
focal_class.modifier: private
focal_class.original_string: private LocalAuthorityService localAuthorityService;
focal_class.type: LocalAuthorityService
focal_class.var_name: localAuthorityService
focal_class.declarator: restTemplate
focal_class.modifier: private
focal_class.original_string: private RestTemplate restTemplate;
focal_class.type: RestTemplate
focal_class.var_name: restTemplate
focal_class.declarator: acteService
focal_class.modifier: private
focal_class.original_string: private ActeService acteService;
focal_class.type: ActeService
focal_class.var_name: acteService
focal_class.declarator: dataOwnerSiren
focal_class.modifier: @Value("${application.datacore.dataOwnerSiren}")
      private
focal_class.original_string: @Value("${application.datacore.dataOwnerSiren}")
      private String dataOwnerSiren;
focal_class.type: String
focal_class.var_name: dataOwnerSiren
focal_class.declarator: dcImporterUrl
focal_class.modifier: @Value("${application.datacore.dcImporterUrl}")
      private
focal_class.original_string: @Value("${application.datacore.dcImporterUrl}")
      private String dcImporterUrl;
focal_class.type: String
focal_class.var_name: dcImporterUrl
focal_class.declarator: baseUri
focal_class.modifier: @Value("${application.datacore.baseUri}")
      private
focal_class.original_string: @Value("${application.datacore.baseUri}")
      private String baseUri;
focal_class.type: String
focal_class.var_name: baseUri
focal_class.declarator: applicationUrl
focal_class.modifier: @Value("${application.url}")
      private
focal_class.original_string: @Value("${application.url}")
      private String applicationUrl;
focal_class.type: String
focal_class.var_name: applicationUrl
focal_class.file: acte-service/src/main/java/fr/sictiam/stela/acteservice/service/DcImporterService.java
focal_class.identifier: DcImporterService
focal_class.interfaces: implements ApplicationListener<ActeHistoryEvent>
focal_class.class_method_signature: DcImporterService.DcImporterService(ExternalRestService externalRestService, LocalAuthorityService localAuthorityService, RestTemplate restTemplate, ActeService acteService)
focal_class.full_signature: @Autowired public  DcImporterService(ExternalRestService externalRestService, LocalAuthorityService localAuthorityService, RestTemplate restTemplate, ActeService acteService)
focal_class.identifier: DcImporterService
focal_class.modifiers: @Autowired public
focal_class.parameters: (ExternalRestService externalRestService, LocalAuthorityService localAuthorityService, RestTemplate restTemplate, ActeService acteService)
focal_class.signature:  DcImporterService(ExternalRestService externalRestService, LocalAuthorityService localAuthorityService, RestTemplate restTemplate, ActeService acteService)
focal_class.class_method_signature: DcImporterService.newResource(String type, String project, Map<String, Object> properties, String accessToken)
focal_class.full_signature: public ResponseEntity<?> newResource(String type, String project, Map<String, Object> properties, String accessToken)
focal_class.identifier: newResource
focal_class.modifiers: public
focal_class.parameters: (String type, String project, Map<String, Object> properties, String accessToken)
focal_class.return: ResponseEntity<?>
focal_class.signature: ResponseEntity<?> newResource(String type, String project, Map<String, Object> properties, String accessToken)
focal_class.class_method_signature: DcImporterService.getAccessTokenForDataOwner()
focal_class.full_signature: public Optional<String> getAccessTokenForDataOwner()
focal_class.identifier: getAccessTokenForDataOwner
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Optional<String>
focal_class.signature: Optional<String> getAccessTokenForDataOwner()
focal_class.class_method_signature: DcImporterService.sendPublicActeToDcImporter(Acte acte)
focal_class.full_signature: public void sendPublicActeToDcImporter(Acte acte)
focal_class.identifier: sendPublicActeToDcImporter
focal_class.modifiers: public
focal_class.parameters: (Acte acte)
focal_class.return: void
focal_class.signature: void sendPublicActeToDcImporter(Acte acte)
focal_class.class_method_signature: DcImporterService.buildActeDcUri(String uuid, String siret, String date, String codeMatiere)
focal_class.full_signature: private String buildActeDcUri(String uuid, String siret, String date, String codeMatiere)
focal_class.identifier: buildActeDcUri
focal_class.modifiers: private
focal_class.parameters: (String uuid, String siret, String date, String codeMatiere)
focal_class.return: String
focal_class.signature: String buildActeDcUri(String uuid, String siret, String date, String codeMatiere)
focal_class.class_method_signature: DcImporterService.buildCollectiviteDcUri(String siret)
focal_class.full_signature: private String buildCollectiviteDcUri(String siret)
focal_class.identifier: buildCollectiviteDcUri
focal_class.modifiers: private
focal_class.parameters: (String siret)
focal_class.return: String
focal_class.signature: String buildCollectiviteDcUri(String siret)
focal_class.class_method_signature: DcImporterService.buildAttachementUrl(String uuid)
focal_class.full_signature: private String buildAttachementUrl(String uuid)
focal_class.identifier: buildAttachementUrl
focal_class.modifiers: private
focal_class.parameters: (String uuid)
focal_class.return: String
focal_class.signature: String buildAttachementUrl(String uuid)
focal_class.class_method_signature: DcImporterService.deliberationMatiereCodeAdapter(String acteCode)
focal_class.full_signature: private String[] deliberationMatiereCodeAdapter(String acteCode)
focal_class.identifier: deliberationMatiereCodeAdapter
focal_class.modifiers: private
focal_class.parameters: (String acteCode)
focal_class.return: String[]
focal_class.signature: String[] deliberationMatiereCodeAdapter(String acteCode)
focal_class.class_method_signature: DcImporterService.getLevelTwoOfDeliberationMatiereCode(String acteCode)
focal_class.full_signature: private String getLevelTwoOfDeliberationMatiereCode(String acteCode)
focal_class.identifier: getLevelTwoOfDeliberationMatiereCode
focal_class.modifiers: private
focal_class.parameters: (String acteCode)
focal_class.return: String
focal_class.signature: String getLevelTwoOfDeliberationMatiereCode(String acteCode)
focal_class.class_method_signature: DcImporterService.getLocalAuthorityDcId(LocalAuthority localAuthority)
focal_class.full_signature: private String getLocalAuthorityDcId(LocalAuthority localAuthority)
focal_class.identifier: getLocalAuthorityDcId
focal_class.modifiers: private
focal_class.parameters: (LocalAuthority localAuthority)
focal_class.return: String
focal_class.signature: String getLocalAuthorityDcId(LocalAuthority localAuthority)
focal_class.class_method_signature: DcImporterService.onApplicationEvent(@NotNull ActeHistoryEvent event)
focal_class.full_signature: @Override public void onApplicationEvent(@NotNull ActeHistoryEvent event)
focal_class.identifier: onApplicationEvent
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull ActeHistoryEvent event)
focal_class.return: void
focal_class.signature: void onApplicationEvent(@NotNull ActeHistoryEvent event)
focal_method.body: public Optional<String> getAccessTokenForDataOwner() {
          Optional<LocalAuthority> localAuthority = localAuthorityService.getBySiren(dataOwnerSiren);
  
          if(localAuthority.isPresent())
              return externalRestService.getAccessTokenFromKernel(localAuthority.get());
          else {
              LOGGER.warn("[getAccessTokenForDataOwner] Not found local authority for configured dataOwnerSiren {}", dataOwnerSiren);
              return Optional.empty();
          }
      }
focal_method.class_method_signature: DcImporterService.getAccessTokenForDataOwner()
focal_method.full_signature: public Optional<String> getAccessTokenForDataOwner()
focal_method.identifier: getAccessTokenForDataOwner
focal_method.invocations: getBySiren isPresent getAccessTokenFromKernel get warn empty
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Optional<String>
focal_method.signature: Optional<String> getAccessTokenForDataOwner()