in ddm-rrm/src/it/java/com/epam/digital/data/platform/management/MasterVersionBPControllerIT.java [119:151]
void getBusinessProcessesByVersionId() {
// add 2 files to "remote" repo pull head branch repo and add 1 more file to "remote"
final var johnDoesBpContent = context.getResourceContent(
"/versions/master/business-processes/GET/john-does-bp.bpmn");
context.addFileToRemoteHeadRepo("/bpmn/john-does-bp.bpmn", johnDoesBpContent);
final var mrSmithsBpContent = context.getResourceContent(
"/versions/master/business-processes/GET/mr-smiths-bp.bpmn");
context.addFileToRemoteHeadRepo("/bpmn/mr-smiths-bp.bpmn", mrSmithsBpContent);
context.pullHeadRepo();
context.addFileToRemoteHeadRepo("/bpmn/mr-smiths-bp1.bpmn", mrSmithsBpContent);
// define expected john-does-bp dates
final var expectedJohnDoesBpDates = context.getHeadRepoDatesByPath(
"bpmn/john-does-bp.bpmn");
// perform query and expect only 2 of the processes that are pulled on head-branch repo
mockMvc.perform(
get("/versions/master/business-processes")
.accept(MediaType.APPLICATION_JSON)
).andExpectAll(
status().isOk(),
content().contentType(MediaType.APPLICATION_JSON),
jsonPath("$", hasSize(2)),
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"))
);
}