diff --git a/pscload/src/test/java/fr/ans/psc/pscload/component/RunnerTestFailToDownloadRassFile.java b/pscload/src/test/java/fr/ans/psc/pscload/component/RunnerTestFailToDownloadRassFile.java index 5e7bc11..81a0740 100644 --- a/pscload/src/test/java/fr/ans/psc/pscload/component/RunnerTestFailToDownloadRassFile.java +++ b/pscload/src/test/java/fr/ans/psc/pscload/component/RunnerTestFailToDownloadRassFile.java @@ -47,7 +47,7 @@ @ActiveProfiles("test") @ContextConfiguration(classes = PscloadApplication.class) @AutoConfigureMockMvc -public class RunnerTestFailToDownloadRassFile { +class RunnerTestFailToDownloadRassFile { @Autowired private ProcessRegistry registry; diff --git a/pscload/src/test/java/fr/ans/psc/pscload/state/ChangesAppliedTest.java b/pscload/src/test/java/fr/ans/psc/pscload/state/ChangesAppliedTest.java index c068fc9..6dac706 100644 --- a/pscload/src/test/java/fr/ans/psc/pscload/state/ChangesAppliedTest.java +++ b/pscload/src/test/java/fr/ans/psc/pscload/state/ChangesAppliedTest.java @@ -59,7 +59,7 @@ @ActiveProfiles("test") @ContextConfiguration(classes = PscloadApplication.class) @AutoConfigureMockMvc -public class ChangesAppliedTest { +class ChangesAppliedTest { @Autowired private CustomMetrics customMetrics; @@ -67,8 +67,8 @@ public class ChangesAppliedTest { @Autowired private ProcessRegistry registry; - @Autowired - private EmailService emailService; + @Autowired + private EmailService emailService; /** @@ -101,7 +101,7 @@ static void registerPgProperties(DynamicPropertyRegistry propertiesRegistry) { * @throws Exception the exception */ @BeforeEach - public void setup() { + void setup() { File outputfolder = new File(Thread.currentThread().getContextClassLoader().getResource("work").getPath()); File[] files = outputfolder.listFiles(); if (files != null) { // some JVMs return null for empty dirs @@ -124,7 +124,7 @@ public void setup() { // CAS 100% PASSANT : pas de message généré, appel à extract @Test @DisplayName("Changes applied with no errors") - public void changesApplied() throws DuplicateKeyException, IOException, ClassNotFoundException { + void changesApplied() throws DuplicateKeyException, IOException, ClassNotFoundException { httpMockServer.stubFor(post("/v2/ps").willReturn(aResponse().withStatus(200))); ClassLoader cl = Thread.currentThread().getContextClassLoader(); @@ -176,11 +176,11 @@ public void changesApplied() throws DuplicateKeyException, IOException, ClassNot p2.nextStep(); OperationMap psToCreate = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE)) - .findFirst().get(); + .findFirst().get(); OperationMap psToUpdate = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.UPDATE)) - .findFirst().get(); + .findFirst().get(); OperationMap psToDelete = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.DELETE)) - .findFirst().get(); + .findFirst().get(); // 2xx return status should have been removed from update map assertEquals(1, psToCreate.size()); assertEquals(1, psToDelete.size()); diff --git a/pscload/src/test/java/fr/ans/psc/pscload/state/UploadingStateTest.java b/pscload/src/test/java/fr/ans/psc/pscload/state/UploadingStateTest.java index 3efb0ca..80db0e7 100644 --- a/pscload/src/test/java/fr/ans/psc/pscload/state/UploadingStateTest.java +++ b/pscload/src/test/java/fr/ans/psc/pscload/state/UploadingStateTest.java @@ -61,7 +61,7 @@ @ActiveProfiles("test") @ContextConfiguration(classes = PscloadApplication.class) @AutoConfigureMockMvc -public class UploadingStateTest { +class UploadingStateTest { @Autowired private CustomMetrics customMetrics; @@ -69,8 +69,8 @@ public class UploadingStateTest { @Autowired private ProcessRegistry registry; - @Autowired - private EmailService emailService; + @Autowired + private EmailService emailService; /** * The http api mock server. @@ -97,23 +97,23 @@ static void registerPgProperties(DynamicPropertyRegistry propertiesRegistry) { propertiesRegistry.add("files.directory", ()-> Thread.currentThread().getContextClassLoader().getResource("work").getPath()); } - /** - * Setup. - * - * @throws Exception the exception - */ - @BeforeEach - void setup() { - registry.clear(); - // clear work directory - File outputfolder = new File(Thread.currentThread().getContextClassLoader().getResource("work").getPath()); - File[] files = outputfolder.listFiles(); - if (files != null) { // some JVMs return null for empty dirs - for (File f : files) { - f.delete(); - } - } - } + /** + * Setup. + * + * @throws Exception the exception + */ + @BeforeEach + void setup() { + registry.clear(); + // clear work directory + File outputfolder = new File(Thread.currentThread().getContextClassLoader().getResource("work").getPath()); + File[] files = outputfolder.listFiles(); + if (files != null) { // some JVMs return null for empty dirs + for (File f : files) { + f.delete(); + } + } + } /** * Upload changes delete PS. @@ -162,12 +162,12 @@ void uploadChangesDeletePS() throws Exception { p2.setState(new UploadingChanges(exclusions, httpApiMockServer.baseUrl())); p2.getState().setProcess(p2); p2.nextStep(); - OperationMap psToCreate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE)) - .findFirst().get(); + OperationMap psToCreate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE)) + .findFirst().get(); OperationMap psToDelete2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.DELETE)) - .findFirst().get(); + .findFirst().get(); OperationMap psToUpdate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.UPDATE)) - .findFirst().get(); + .findFirst().get(); assertEquals(0, psToCreate2.size()); assertEquals(0, psToDelete2.size()); assertEquals(0, psToUpdate2.size()); @@ -227,12 +227,12 @@ void uploadChangesDeletePS410() throws Exception { p2.setState(new UploadingChanges(exclusions, httpApiMockServer.baseUrl())); p2.nextStep(); - OperationMap psToCreate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE)) - .findFirst().get(); + OperationMap psToCreate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE)) + .findFirst().get(); OperationMap psToDelete2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.DELETE)) - .findFirst().get(); + .findFirst().get(); OperationMap psToUpdate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.UPDATE)) - .findFirst().get(); + .findFirst().get(); assertEquals(0, psToCreate2.size()); assertEquals(1, psToDelete2.size()); assertEquals(0, psToUpdate2.size());