void getOfficerRuntimeProcessInstances()

in src/it/java/com/epam/digital/data/platform/bphistory/service/api/controller/ProcessRuntimeControllerIT.java [36:56]


  void getOfficerRuntimeProcessInstances() throws Exception {
    createBpmHistoryProcessAndSaveToDatabase("officerActiveProcess", "processDefinition",
        LocalDateTime.of(2022, 1, 11, 12, 16), "ACTIVE", "testuser", null);
    createBpmHistoryProcessAndSaveToDatabase("officerPendingProcess", "processDefinition",
        LocalDateTime.of(2022, 1, 11, 12, 17), "ACTIVE", "testuser", null);
    createBpmHistoryProcessAndSaveToDatabase("officerSuspendedProcess", "processDefinition",
        LocalDateTime.of(2022, 1, 11, 12, 18), "SUSPENDED", "testuser", null);
    createBpmHistoryTaskAndSaveToDatabase("officerCompletedTask", "officerActiveProcess",
        LocalDateTime.of(2022, 1, 11, 12, 36),
        LocalDateTime.of(2022, 1, 11, 12, 37), "testuser");
    createBpmHistoryTaskAndSaveToDatabase("officerTask", "officerPendingProcess",
        LocalDateTime.of(2022, 1, 11, 12, 17), null, "testuser");

    var expectedJson = TestUtils.readClassPathResource(
        "/json/getOfficerRuntimeProcessInstancesExpectedResponse.json");

    mockMvc.perform(get("/api/runtime/process-instances")
            .header(X_ACCESS_TOKEN.getHeaderName(), OFFICER_TOKEN))
        .andExpect(status().is2xxSuccessful())
        .andExpect(content().json(expectedJson));
  }