From 3951fe5c134d6612a3173b22aa3be182a63788ce Mon Sep 17 00:00:00 2001 From: jayanta2018 Date: Fri, 10 May 2024 11:26:11 +0100 Subject: [PATCH] fix: handle pull request comments --- .../tis/sync/job/PersonDateChangeCaptureSyncJobTemplate.java | 2 +- .../java/uk/nhs/tis/sync/job/PostFundingSyncJobTest.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/uk/nhs/tis/sync/job/PersonDateChangeCaptureSyncJobTemplate.java b/src/main/java/uk/nhs/tis/sync/job/PersonDateChangeCaptureSyncJobTemplate.java index b8a41e86..7e9c95df 100644 --- a/src/main/java/uk/nhs/tis/sync/job/PersonDateChangeCaptureSyncJobTemplate.java +++ b/src/main/java/uk/nhs/tis/sync/job/PersonDateChangeCaptureSyncJobTemplate.java @@ -90,7 +90,7 @@ protected void runSyncJob(String dateOption) { }); } - protected void doDataSync(String dateOption) { + private void doDataSync(String dateOption) { // Configure run LocalDate dateOfChange = magicallyGetDateOfChanges(dateOption); String queryString = buildQueryForDate(dateOfChange); diff --git a/src/test/java/uk/nhs/tis/sync/job/PostFundingSyncJobTest.java b/src/test/java/uk/nhs/tis/sync/job/PostFundingSyncJobTest.java index 5dd2af21..c87a270e 100644 --- a/src/test/java/uk/nhs/tis/sync/job/PostFundingSyncJobTest.java +++ b/src/test/java/uk/nhs/tis/sync/job/PostFundingSyncJobTest.java @@ -15,6 +15,7 @@ import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -98,10 +99,10 @@ void testJobShouldChangeCurrentPostFundingToInactive() { PostFunding postFunding = new PostFunding(); postFunding.setId(999L); post.fundingStatus(Status.CURRENT); - Set postFundingSet = new HashSet<>(Arrays.asList(postFunding)); + Set postFundingSet = Collections.singleton(postFunding); post.setFundings(postFundingSet); - when(entityManager.find(eq(Post.class), anyLong())).thenReturn(post); + when(entityManager.find(eq(Post.class), eq(post.getId()))).thenReturn(post); List entityData = Arrays.asList(1L);