void getBusinessProcessesByVersionId()

in ddm-rrm/src/it/java/com/epam/digital/data/platform/management/CandidateVersionBPControllerIT.java [127:159]


    void getBusinessProcessesByVersionId() {
      // add files to "remote" repo
      final var johnDoesBpContent = context.getResourceContent(
          "/versions/candidates/{versionCandidateId}/business-processes/GET/john-does-bp.bpmn");
      context.addFileToRemoteHeadRepo("/bpmn/john-does-bp.bpmn", johnDoesBpContent);
      final var mrSmithsBpContent = context.getResourceContent(
          "/versions/candidates/{versionCandidateId}/business-processes/GET/mr-smiths-bp.bpmn");
      context.addFileToRemoteHeadRepo("/bpmn/mr-smiths-bp.bpmn", mrSmithsBpContent);

      // mock gerrit change info for version candidate
      final var versionCandidateId = context.createVersionCandidate();

      // define expected john-does-bp dates
      final var expectedJohnDoesBpDates = context.getHeadRepoDatesByPath(
          "bpmn/john-does-bp.bpmn");

      // perform query
      mockMvc.perform(
          get("/versions/candidates/{versionCandidateId}/business-processes", versionCandidateId)
              .accept(MediaType.APPLICATION_JSON)
      ).andExpectAll(
          status().isOk(),
          content().contentType(MediaType.APPLICATION_JSON),
          jsonPath("$[0].name", is("john-does-bp")),
          jsonPath("$[0].title", is("John Doe's BP")),
          jsonPath("$[0].created", is(expectedJohnDoesBpDates.getCreated())),
          jsonPath("$[0].updated", is(expectedJohnDoesBpDates.getUpdated())),
          jsonPath("$[1].name", is("mr-smiths-bp")),
          jsonPath("$[1].title", is("Mr Smith's BP")),
          jsonPath("$[1].created", is("2022-10-28T06:16:26.123Z")),
          jsonPath("$[1].updated", is("2022-10-28T20:26:26.123Z"))
      );
    }