Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
@ActiveProfiles("test")
@ContextConfiguration(classes = PscloadApplication.class)
@AutoConfigureMockMvc
public class RunnerTestFailToDownloadRassFile {
class RunnerTestFailToDownloadRassFile {

@Autowired
private ProcessRegistry registry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@
@ActiveProfiles("test")
@ContextConfiguration(classes = PscloadApplication.class)
@AutoConfigureMockMvc
public class ChangesAppliedTest {
class ChangesAppliedTest {

@Autowired
private CustomMetrics customMetrics;

@Autowired
private ProcessRegistry registry;

@Autowired
private EmailService emailService;
@Autowired
private EmailService emailService;


/**
Expand Down Expand Up @@ -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
Expand All @@ -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();
Expand Down Expand Up @@ -176,11 +176,11 @@ public void changesApplied() throws DuplicateKeyException, IOException, ClassNot
p2.nextStep();

OperationMap<String, RassEntity> psToCreate = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE))
.findFirst().get();
.findFirst().get();
OperationMap<String, RassEntity> psToUpdate = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.UPDATE))
.findFirst().get();
.findFirst().get();
OperationMap<String, RassEntity> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@
@ActiveProfiles("test")
@ContextConfiguration(classes = PscloadApplication.class)
@AutoConfigureMockMvc
public class UploadingStateTest {
class UploadingStateTest {

@Autowired
private CustomMetrics customMetrics;

@Autowired
private ProcessRegistry registry;

@Autowired
private EmailService emailService;
@Autowired
private EmailService emailService;

/**
* The http api mock server.
Expand All @@ -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.
Expand Down Expand Up @@ -162,12 +162,12 @@ void uploadChangesDeletePS() throws Exception {
p2.setState(new UploadingChanges(exclusions, httpApiMockServer.baseUrl()));
p2.getState().setProcess(p2);
p2.nextStep();
OperationMap<String, RassEntity> psToCreate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE))
.findFirst().get();
OperationMap<String, RassEntity> psToCreate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE))
.findFirst().get();
OperationMap<String, RassEntity> psToDelete2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.DELETE))
.findFirst().get();
.findFirst().get();
OperationMap<String, RassEntity> 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());
Expand Down Expand Up @@ -227,12 +227,12 @@ void uploadChangesDeletePS410() throws Exception {

p2.setState(new UploadingChanges(exclusions, httpApiMockServer.baseUrl()));
p2.nextStep();
OperationMap<String, RassEntity> psToCreate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE))
.findFirst().get();
OperationMap<String, RassEntity> psToCreate2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.CREATE))
.findFirst().get();
OperationMap<String, RassEntity> psToDelete2 = p2.getMaps().stream().filter(map -> map.getOperation().equals(OperationType.DELETE))
.findFirst().get();
.findFirst().get();
OperationMap<String, RassEntity> 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());
Expand Down