### Question:
UserRequest { public SCIMResponse<PagedByIndexSearchResult<User>> readMultipleUsers() { return resourceRequestDelegate.readMultipleResources(new GenericType<PagedByIndexSearchResult<User>>(){}); } UserRequest(WebTarget targetSystem, SCIMRequest scimRequest); SCIMResponse<User> createUser(User user); SCIMResponse<User> readSingleUser(String id); SCIMResponse<PagedByIndexSearchResult<User>> readAllUsers(); SCIMResponse<PagedByIndexSearchResult<User>> readAllUsers(String scimFilter); SCIMResponse<PagedByIndexSearchResult<User>> readMultipleUsers(); SCIMResponse<PagedByIndexSearchResult<User>> readMultipleUsers(String filter); SCIMResponse<PagedByIdentitySearchResult<User>> readMultipleUsers(IdentityPageQuery identityPageQuery); SCIMResponse<PagedByIdentitySearchResult<User>> readMultipleUsers(IdentityPageQuery identityPageQuery, String filter); SCIMResponse<PagedByIndexSearchResult<User>> readMultipleUsers(IndexPageQuery indexPageQuery); SCIMResponse<PagedByIndexSearchResult<User>> readMultipleUsers(IndexPageQuery indexPageQuery, String filter); SCIMResponse<PagedByIndexSearchResult<User>> readMultipleUsersWithoutPaging(); SCIMResponse<PagedByIndexSearchResult<User>> readMultipleUsersWithoutPaging(String filter); SCIMResponse<User> updateUser(User user); SCIMResponse<Void> patchUser(PatchBody patchBody, String userId); SCIMResponse<Void> deleteUser(String userId);  }### Answer:
@Test public void testReadUsersWithPagedByIdentityResponse() throws IOException { JsonNode jsonResponse = readResponseUserAsJsonNodeFromFile("read_users_identity_paging.json"); String startId = "aaaa"; wireMockServer.stubFor(get(urlEqualTo(String.format("/Users?startId=%s&count=100", startId))).willReturn(configureMockedResponse(OK, jsonResponse))); SCIMResponse<PagedByIdentitySearchResult<User>> resp = SCIMClientService.builder(DEFAULT_URL) .build() .buildUserRequest() .readMultipleUsers(identityPageQuery().withStartId(startId).withCount(100)); PagedByIdentitySearchResult<User> receivedResponse = resp.get(); assertAll( () -> assertAll(getPagedByIdentityResponseAssertions(receivedResponse)), () -> { User user = receivedResponse.getResources().stream().findAny().orElseThrow(RuntimeException::new); assertAll("Common resourceAttributes", getCommonResourceAssertions(user, User.SCHEMA)); assertAll( () -> assertNotNull(user.getUserName()), () -> assertNotNull(user.getDisplayName()), () -> assertNotNull(user.isActive()) ); } ); }
@TestFactory public Collection<DynamicTest> testReadUsersWithIndexPagedResponse() throws IOException { return Arrays.asList( dynamicTest("read All Users", getUsersIndexPagingExecutable("/Users?startIndex=1&count=100", UserRequest::readAllUsers)), dynamicTest("read multiple Users default index paging", getUsersIndexPagingExecutable("/Users?startIndex=1&count=100", UserRequest::readMultipleUsers)), dynamicTest("read multiple Users custom index paging", getUsersIndexPagingExecutable("/Users?startIndex=3&count=40", scimUserRequest -> scimUserRequest.readMultipleUsers(indexPageQuery().withStartIndex(3).withCount(40)))), dynamicTest("read multiple Users without adding page parameters", getUsersIndexPagingExecutable("/Users", UserRequest::readMultipleUsersWithoutPaging)) ); }