@Test
public void tetGetMachines() throws Exception {

    MachineQueryResult mockResponse = MachineQueryResult.newBuilder()
            .setPagination(SpringMockMvcUtil.paginationOf(NEXT_PAGE_OF_1))
            .addAllItems(asList(MACHINE_1, MACHINE_2))
            .build();
    QueryRequest stubRequest = QueryRequest.newBuilder()
            .setPage(NEXT_PAGE_OF_1)
            .build();
    when(serviceMock.getMachines(stubRequest)).thenReturn(Mono.just(mockResponse));
    MachineQueryResult entity = SpringMockMvcUtil.doPaginatedGet(mockMvc, "/api/v4/machines", MachineQueryResult.class, NEXT_PAGE_OF_1);
    assertThat(entity).isEqualTo(mockResponse);
}