diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/Application.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/Application.java index c626006..27a365f 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/Application.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/Application.java @@ -1,23 +1,19 @@ package com.iqser.red.service.redaction.report.v1.server; +import com.iqser.red.commons.spring.DefaultWebMvcConfiguration; +import com.iqser.red.service.redaction.report.v1.server.settings.RedactionReportSettings; import org.springframework.boot.SpringApplication; import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Import; import org.springframework.scheduling.annotation.EnableAsync; -import com.iqser.red.commons.spring.DefaultWebMvcConfiguration; -import com.iqser.red.service.redaction.report.v1.server.client.LegalBasisMappingClient; -import com.iqser.red.service.redaction.report.v1.server.settings.RedactionReportSettings; - @EnableAsync @EnableConfigurationProperties(RedactionReportSettings.class) @SpringBootApplication(exclude = {SecurityAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class}) @Import(DefaultWebMvcConfiguration.class) -@EnableFeignClients(basePackageClasses = {LegalBasisMappingClient.class}) public class Application { /** diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportIntegrationTest.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportIntegrationTest.java index e953d7c..d217db1 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportIntegrationTest.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/java/com/iqser/red/service/redaction/report/v1/server/RedactionReportIntegrationTest.java @@ -1,17 +1,14 @@ package com.iqser.red.service.redaction.report.v1.server; import com.fasterxml.jackson.databind.ObjectMapper; -import com.iqser.red.service.configuration.v1.api.model.LegalBasisMapping; import com.iqser.red.service.redaction.report.v1.api.model.MultiFileRedactionLog; import com.iqser.red.service.redaction.report.v1.api.model.ReportResult; -import com.iqser.red.service.redaction.report.v1.server.client.LegalBasisMappingClient; import com.iqser.red.service.redaction.report.v1.server.controller.RedactionReportController; import com.iqser.red.service.redaction.v1.model.RedactionLog; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.core.io.ClassPathResource; import org.springframework.test.context.junit4.SpringRunner; @@ -19,7 +16,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.List; -import static org.mockito.Mockito.when; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @RunWith(SpringRunner.class) @@ -32,19 +28,9 @@ public class RedactionReportIntegrationTest { @Autowired private RedactionReportController redactionReportController; - @MockBean - private LegalBasisMappingClient legalBasisMappingClient; - - @Test public void testReportGeneration() throws IOException { - ClassPathResource legalBasisMappingResource = new ClassPathResource("files/LegalBasisMapping.json"); - - LegalBasisMapping legalBasisMapping = objectMapper.readValue(legalBasisMappingResource.getInputStream(), LegalBasisMapping.class); - - when(legalBasisMappingClient.getLegalBasisMapping("123")).thenReturn(legalBasisMapping); - ClassPathResource redactionLogResource = new ClassPathResource("files/RedactedLog.txt"); RedactionLog redactionLog = objectMapper.readValue(redactionLogResource.getInputStream(), RedactionLog.class); diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/files/LegalBasisMapping.json b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/files/LegalBasisMapping.json index 6d389cf..938ce6e 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/files/LegalBasisMapping.json +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/test/resources/files/LegalBasisMapping.json @@ -1 +1,11 @@ -{"reasonByLegalBasis":{"Reg (EC) No 1107/2009 Art. 63 (2d)":"methods of analysis for impurities in the active substance as manufactured except for methods for impurities that are considered to be toxicologically, ecotoxicologically or environmentally relevant","Reg (EC) No 1107/2009 Art. 63 (2c)":"results of production batches of the active substance including impurities","Reg (EC) No 1107/2009 Art. 63 (2b)":"the specification of impurity of the active substance except for the impurities that are considered to be toxicologically, ecotoxicologically or environmentally relevant","Reg (EC) No 1107/2009 Art. 63 (2a)":"the method of manufacture","Reg (EC) No 1107/2009 Art. 63 (2g)":"names and addresses of persons involved in testing on vertebrate animals","Reg (EC) No 1107/2009 Art. 63 (2f)":"information on the complete composition of a plant protection product","Reg (EC) No 1107/2009 Art. 63 (2e)":"links between a producer or importer and the applicant or the authorisation holder"}} \ No newline at end of file +{ + "reasonByLegalBasis": { + "Reg (EC) No 1107/2009 Art. 63 (2d)": "methods of analysis for impurities in the active substance as manufactured except for methods for impurities that are considered to be toxicologically, ecotoxicologically or environmentally relevant", + "Reg (EC) No 1107/2009 Art. 63 (2c)": "results of production batches of the active substance including impurities", + "Reg (EC) No 1107/2009 Art. 63 (2b)": "the specification of impurity of the active substance except for the impurities that are considered to be toxicologically, ecotoxicologically or environmentally relevant", + "Reg (EC) No 1107/2009 Art. 63 (2a)": "the method of manufacture", + "Reg (EC) No 1107/2009 Art. 63 (2g)": "names and addresses of persons involved in testing on vertebrate animals", + "Reg (EC) No 1107/2009 Art. 63 (2f)": "information on the complete composition of a plant protection product", + "Reg (EC) No 1107/2009 Art. 63 (2e)": "links between a producer or importer and the applicant or the authorisation holder" + } +} \ No newline at end of file