in src/it/java/com/epam/digital/data/platform/bphistory/service/api/controller/ProcessRuntimeControllerIT.java [59:79]
void getCitizenRuntimeProcessInstances() throws Exception {
createBpmHistoryProcessAndSaveToDatabase("citizenActiveProcess", "processDefinition",
LocalDateTime.of(2022, 1, 11, 12, 35), "ACTIVE", "testuser", null);
createBpmHistoryProcessAndSaveToDatabase("citizenPendingProcess", "processDefinition",
LocalDateTime.of(2022, 1, 11, 12, 36), "ACTIVE", "testuser", null);
createBpmHistoryProcessAndSaveToDatabase("citizenSuspendedProcess", "processDefinition",
LocalDateTime.of(2022, 1, 11, 12, 37), "SUSPENDED", "testuser", null);
createBpmHistoryTaskAndSaveToDatabase("citizenCompletedTask", "citizenActiveProcess",
LocalDateTime.of(2022, 1, 11, 12, 36),
LocalDateTime.of(2022, 1, 11, 12, 37), "testuser");
createBpmHistoryTaskAndSaveToDatabase("citizenTask", "citizenPendingProcess",
LocalDateTime.of(2022, 1, 11, 12, 36), null, "testuser");
var expectedJson = TestUtils.readClassPathResource(
"/json/getCitizenRuntimeProcessInstancesExpectedResponse.json");
mockMvc.perform(get("/api/runtime/process-instances")
.header(X_ACCESS_TOKEN.getHeaderName(), CITIZEN_TOKEN))
.andExpect(status().is2xxSuccessful())
.andExpect(content().json(expectedJson));
}