Skip to content

Commit

Permalink
fix: lombok build error
Browse files Browse the repository at this point in the history
  • Loading branch information
jayanta2018 committed Apr 18, 2024
1 parent c654805 commit e723b4c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<version>1.18.20</version>
</path>
<path>
<groupId>org.mapstruct</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public void setRevalCurrentPmSyncJob(RevalCurrentPmSyncJob revalCurrentPmSyncJob
this.revalCurrentPmSyncJob = revalCurrentPmSyncJob;
}

@Autowired(required = false)
public void setPostFundingSyncJob(PostFundingSyncJob postFundingSyncJob) {
this.postFundingSyncJob = postFundingSyncJob;
}

@Override
public void onApplicationEvent(ApplicationReadyEvent event) {
LOG.debug("Received event for an {}", event.getClass().getSimpleName());
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/uk/nhs/tis/sync/job/PostFundingSyncJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@
import java.util.Objects;
import java.util.Set;
import javax.persistence.EntityManager;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.scheduling.annotation.Scheduled;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component;

@Component
@ManagedResource(objectName = "sync.mbean:name=PostFundingSyncJob",
description = "Job for updating funding status for posts")
public class PostFundingSyncJob extends PersonDateChangeCaptureSyncJobTemplate<Post> {

private static final Logger LOG = LoggerFactory.getLogger(PostFundingSyncJob.class);
Expand All @@ -40,6 +44,7 @@ public void run(String params) {
}

@Scheduled(cron = "${application.cron.postFundingSyncJob}")
@ManagedOperation(description = "update post funding status")
public void postFundingSyncJob() {
super.runSyncJob(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ public void testRunJobs() {
when(personOwnerRebuildJob.isCurrentlyRunning()).thenReturn(false);
when(personElasticSearchSyncJob.isCurrentlyRunning()).thenReturn(false);
when(revalCurrentPmSyncJob.isCurrentlyRunning()).thenReturn(false);
when(personOwnerRebuildJob.isCurrentlyRunning()).thenReturn(false);
when(postFundingSyncJob.isCurrentlyRunning()).thenReturn(false);
testClass.runJobs();
verify(personOwnerRebuildJob).personOwnerRebuildJob();
verify(personOwnerRebuildJob).isCurrentlyRunning();
verify(personElasticSearchSyncJob).personElasticSearchSync();
verify(personElasticSearchSyncJob).isCurrentlyRunning();
verify(revalCurrentPmSyncJob).isCurrentlyRunning();
verify(postFundingSyncJob).postFundingSyncJob();
verify(postFundingSyncJob).isCurrentlyRunning();
}
}

0 comments on commit e723b4c

Please sign in to comment.