@Test
public void testFindJobs() throws Exception {

    JobQuery forwardedRequest = JobQuery.newBuilder()
            .putFilteringCriteria("filter1", "value1")
            .setPage(NEXT_PAGE_OF_2)
            .build();
    JobQueryResult expectedResult = JobQueryResult.newBuilder()
            .setPagination(paginationOf(NEXT_PAGE_OF_2))
            .addAllItems(asList(JOB_1, JOB_2))
            .build();
    when(jobServiceGatewayMock.findJobs(forwardedRequest, JUNIT_REST_CALL_METADATA)).thenReturn(Observable.just(expectedResult));
    JobQueryResult entity = SpringMockMvcUtil.doPaginatedGet(mockMvc, "/api/v3/jobs", JobQueryResult.class, NEXT_PAGE_OF_2, "filter1", "value1");
    assertThat(entity).isEqualTo(expectedResult);
    verify(jobServiceGatewayMock, times(1)).findJobs(forwardedRequest, JUNIT_REST_CALL_METADATA);
}