[CST-5755] removed Gson usage and small code refactoring

This commit is contained in:
corrado lombardi
2022-05-12 19:13:30 +02:00
parent cb0a6651f7
commit 7de7ba26ce

View File

@@ -564,7 +564,7 @@ public class ScriptRestRepositoryIT extends AbstractControllerIntegrationTest {
try { try {
getClient(token).perform(post("/api/system/scripts/mock-script/processes") getClient(token).perform(post("/api/system/scripts/mock-script/processes")
.contentType("multipart/form-data") .contentType("multipart/form-data")
.param("properties", new Gson().toJson(list))) .param("properties", new ObjectMapper().writeValueAsString(list)))
.andExpect(status().isAccepted()) .andExpect(status().isAccepted())
.andExpect(jsonPath("$", is(ProcessMatcher.matchProcess("mock-script", .andExpect(jsonPath("$", is(ProcessMatcher.matchProcess("mock-script",
String.valueOf(admin.getID()), String.valueOf(admin.getID()),
@@ -573,12 +573,12 @@ public class ScriptRestRepositoryIT extends AbstractControllerIntegrationTest {
Process process = processService.find(context, idRef.get()); Process process = processService.find(context, idRef.get());
List<Group> groups = process.getGroups(); List<Group> groups = process.getGroups();
boolean isPresent = false; boolean isPresent = groups.stream().anyMatch(g -> g.getID().equals(specialGroup.getID()));
for (Group group : groups) { // for (Group group : groups) {
if (group.getID().equals(specialGroup.getID())) { // if (group.getID().equals(specialGroup.getID())) {
isPresent = true; // isPresent = true;
} // }
} // }
assertTrue(isPresent); assertTrue(isPresent);
} finally { } finally {