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 newResource() {
          stubFor(post(urlPathEqualTo("/dc/type/legal:type_0")).willReturn(created()));
  
          ResponseEntity responseEntity = dcImporterService.newResource("legal:type_0", "test_0", this.resourceProperties(), "access-token-test");
  
          WireMock.verify(postRequestedFor(urlPathEqualTo("/dc/type/legal:type_0"))
                  .withHeader(HttpHeaders.AUTHORIZATION, equalTo("Bearer access-token-test"))
                  .withHeader(HttpHeaders.CONTENT_TYPE, equalTo(ContentType.APPLICATION_JSON.getMimeType()))
                  .withHeader("X-Datacore-Project", equalTo("test_0"))
                  .withRequestBody(equalToJson(this.resourceRequestBody())));
  
          Assert.assertEquals(responseEntity.getStatusCode(), HttpStatus.CREATED);
      }
test_case.class_method_signature: DcImporterServiceTest.newResource()
test_case.full_signature: @Test public void newResource()
test_case.identifier: newResource
test_case.invocations: stubFor willReturn post urlPathEqualTo created newResource resourceProperties verify withRequestBody withHeader withHeader withHeader postRequestedFor urlPathEqualTo equalTo equalTo getMimeType equalTo equalToJson resourceRequestBody assertEquals getStatusCode
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void newResource()
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 ResponseEntity<?> newResource(String type, String project, Map<String, Object> properties, String accessToken) throws RestClientResponseException {
          HttpHeaders headers = new HttpHeaders();
          headers.add(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());
          headers.add(HttpHeaders.AUTHORIZATION, "Bearer ".concat(accessToken));
          headers.add("X-Datacore-Project", project);
  
          return restTemplate.postForEntity(dcImporterUrl.concat("/dc/type/{type}"), new HttpEntity<>(properties, headers), String.class, type);
      }
focal_method.class_method_signature: DcImporterService.newResource(String type, String project, Map<String, Object> properties, String accessToken)
focal_method.full_signature: public ResponseEntity<?> newResource(String type, String project, Map<String, Object> properties, String accessToken)
focal_method.identifier: newResource
focal_method.invocations: add getMimeType add concat add postForEntity concat
focal_method.modifiers: public
focal_method.parameters: (String type, String project, Map<String, Object> properties, String accessToken)
focal_method.return: ResponseEntity<?>
focal_method.signature: ResponseEntity<?> newResource(String type, String project, Map<String, Object> properties, String accessToken)