ManaMatrix commented on code in PR #28842:
URL: https://github.com/apache/shardingsphere/pull/28842#discussion_r1368424881
##########
test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/job/service/GovernanceRepositoryAPIImplTest.java:
##########
@@ -155,7 +156,26 @@ void assertPersistJobOffsetInfo() {
assertTrue(actual.isPresent());
assertThat(actual.get(), is("testValue"));
}
-
+
+ @Test
+ void testGovernanceRepositoryAPIImplMethods() {
+ String parentJobId1 = "parentJob123";
+ String checkJobId1 = "checkJob456";
+ governanceRepositoryAPI.persistLatestCheckJobId(parentJobId1,
checkJobId1);
+ Optional<String> retrievedCheckJobId1 =
governanceRepositoryAPI.getLatestCheckJobId(parentJobId1);
Review Comment:
Solved!
##########
test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/core/job/service/GovernanceRepositoryAPIImplTest.java:
##########
@@ -155,7 +156,26 @@ void assertPersistJobOffsetInfo() {
assertTrue(actual.isPresent());
assertThat(actual.get(), is("testValue"));
}
-
+
+ @Test
+ void testGovernanceRepositoryAPIImplMethods() {
+ String parentJobId1 = "parentJob123";
+ String checkJobId1 = "checkJob456";
+ governanceRepositoryAPI.persistLatestCheckJobId(parentJobId1,
checkJobId1);
+ Optional<String> retrievedCheckJobId1 =
governanceRepositoryAPI.getLatestCheckJobId(parentJobId1);
+ assertTrue(retrievedCheckJobId1.isPresent(), "Expected a checkJobId to
be present");
+ assertEquals(retrievedCheckJobId1.get(), checkJobId1, "The retrieved
checkJobId does not match the persisted one");
+ String parentJobId2 = "parentJob789";
+ String checkJobId2 = "checkJob012";
+ governanceRepositoryAPI.persistLatestCheckJobId(parentJobId2,
checkJobId2);
+ Optional<String> retrievedCheckJobId2 =
governanceRepositoryAPI.getLatestCheckJobId(parentJobId2);
+ assertTrue(retrievedCheckJobId2.isPresent(), "Expected a checkJobId to
be present");
+ assertEquals(checkJobId2, retrievedCheckJobId2.get(), "The retrieved
checkJobId does not match the expected one");
+ governanceRepositoryAPI.deleteLatestCheckJobId(parentJobId2);
+
assertFalse(governanceRepositoryAPI.getLatestCheckJobId(parentJobId2).isPresent(),
"Expected no checkJobId to be present after deletion");
Review Comment:
Solved!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]