Skip to content

Commit

Permalink
Add unit test in GovernanceRepositoryAPIImplTest (#28747)
Browse files Browse the repository at this point in the history
* Add unit test in GovernanceRepositoryAPIImplTest for persistJobOffsetInfo and getJobOffsetInfo

* Fix style check
  • Loading branch information
pavanbaloju authored Oct 15, 2023
1 parent 3e03fd6 commit b8427b8
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ void assertGetShardingItems() {
assertThat(shardingItems.get(0), is(jobItemContext.getShardingItem()));
}

@Test
void assertPersistJobOffsetInfo() {
assertFalse(governanceRepositoryAPI.getJobOffsetInfo("1").isPresent());
governanceRepositoryAPI.persistJobOffsetInfo("1", "testValue");
Optional<String> actual = governanceRepositoryAPI.getJobOffsetInfo("1");
assertTrue(actual.isPresent());
assertThat(actual.get(), is("testValue"));
}

private MigrationJobItemContext mockJobItemContext() {
MigrationJobItemContext result = PipelineContextUtils.mockMigrationJobItemContext(JobConfigurationBuilder.createJobConfiguration());
MigrationTaskConfiguration taskConfig = result.getTaskConfig();
Expand Down

0 comments on commit b8427b8

Please sign in to comment.