Source:
public void testAssetReportRefreshSuccessWithOverride() throws Exception { List<String> accessTokens = Arrays.asList(getItemCreateResponse().getAccessToken()); Response<AssetReportCreateResponse> createResponse = AssetReportCreateTest.createAssetReport(client(), accessTokens); String assetReportToken = createResponse.body().getAssetReportToken(); Response<AssetReportGetResponse> response = waitTillReady(client(), assetReportToken); AssetReportGetResponse respBody = response.body(); assertSuccessResponse(response); assertNotNull(respBody.getReport()); assertNotNull(respBody.getReport().getUser()); assertFalse(respBody.getReport().getItems().isEmpty()); assertNotNull(respBody.getReport().getAssetReportId()); AssetReportCreateRequest.Options options = new AssetReportCreateRequest.Options(); Optional<AssetReportCreateRequest.Options.UserOptions> user = Optional.empty(); user = user.orElse(new AssetReportCreateRequest.Options.UserOptions()); user.get().setLastName("newLastName"); options.setUser(user); AssetReportRefreshRequest assetReportRefreshRequest = new AssetReportRefreshRequest(assetReportToken, options); Response<AssetReportCreateResponse> assetReportCreateRefreshResponse = assetReportRefresh(assetReportRefreshRequest); Response<AssetReportGetResponse> assetReportRefreshGetResponse = waitTillReady(client(), assetReportCreateRefreshResponse.body().getAssetReportToken()); Set<AssetReportGetResponse.Item> originalItems = new HashSet<>(response.body().getReport().getItems()); Set<AssetReportGetResponse.Item> refreshItems = new HashSet<>(assetReportRefreshGetResponse.body().getReport().getItems()); assertEquals(originalItems, refreshItems); AssetReportGetResponse.User originalUser = response.body().getReport().getUser(); AssetReportGetResponse.User refreshedUser = assetReportRefreshGetResponse.body().getReport().getUser(); assertEquals(originalUser.getClientUserId(), refreshedUser.getClientUserId()); assertEquals(originalUser.getEmail(), refreshedUser.getEmail()); assertEquals(originalUser.getFirstName(), refreshedUser.getFirstName()); assertEquals(originalUser.getMiddleName(), refreshedUser.getMiddleName()); assertEquals(originalUser.getPhoneNumber(), refreshedUser.getPhoneNumber()); assertEquals(originalUser.getSsn(), refreshedUser.getSsn()); assertEquals("newLastName", refreshedUser.getLastName()); }

Target:
public void testAssetReportRefreshSuccessWithOverride() throws Exception { List<String> accessTokens = Arrays.asList(getItemCreateResponse().getAccessToken()); Response<AssetReportCreateResponse> createResponse = AssetReportCreateTest.createAssetReport(client(), accessTokens); String assetReportToken = createResponse.body().getAssetReportToken(); Response<AssetReportGetResponse> response = waitTillReady(client(), assetReportToken); AssetReportGetResponse respBody = response.body(); assertSuccessResponse(response); assertNotNull(respBody.getReport()); assertNotNull(respBody.getReport().getUser()); assertFalse(respBody.getReport().getItems().isEmpty()); assertNotNull(respBody.getReport().getAssetReportId()); AssetReportCreateRequest.Options options = new AssetReportCreateRequest.Options(); Optional<AssetReportCreateRequest.Options.UserOptions> user = Optional.empty(); user = user.orElse(new AssetReportCreateRequest.Options.UserOptions()); String newLastName = "newLastName"; user.get().setLastName(newLastName); options.setUser(user); AssetReportRefreshRequest assetReportRefreshRequest = new AssetReportRefreshRequest(assetReportToken, options); Response<AssetReportCreateResponse> assetReportCreateRefreshResponse = assetReportRefresh(assetReportRefreshRequest); Response<AssetReportGetResponse> assetReportRefreshGetResponse = waitTillReady(client(), assetReportCreateRefreshResponse.body().getAssetReportToken()); Set<AssetReportGetResponse.Item> originalItems = new HashSet<>(response.body().getReport().getItems()); Set<AssetReportGetResponse.Item> refreshItems = new HashSet<>(assetReportRefreshGetResponse.body().getReport().getItems()); assertEquals(originalItems, refreshItems); AssetReportGetResponse.User originalUser = response.body().getReport().getUser(); AssetReportGetResponse.User refreshedUser = assetReportRefreshGetResponse.body().getReport().getUser(); assertEquals(originalUser.getClientUserId(), refreshedUser.getClientUserId()); assertEquals(originalUser.getEmail(), refreshedUser.getEmail()); assertEquals(originalUser.getFirstName(), refreshedUser.getFirstName()); assertEquals(originalUser.getMiddleName(), refreshedUser.getMiddleName()); assertEquals(originalUser.getPhoneNumber(), refreshedUser.getPhoneNumber()); assertEquals(originalUser.getSsn(), refreshedUser.getSsn()); assertEquals(newLastName, refreshedUser.getLastName()); }