SaketaChalamchala commented on code in PR #10901:
URL: https://github.com/apache/ozone/pull/10901#discussion_r3754225832
##########
hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/snapshot/TestSnapshotDiffResponse.java:
##########
@@ -57,20 +61,48 @@ void testReportOnlyFailedMessageIncludesReason() {
assertTrue(message.contains("resubmit the job without using the
--get-report option"));
}
- @Test
- void testReportOnlyInProgressIncludesSubStatusAndProgress() {
+ @ParameterizedTest
+ @EnumSource(value = SubStatus.class, names = {"OBJECT_ID_MAP_GEN_OBS",
"OBJECT_ID_MAP_GEN_FSO",
+ "OBJECT_ID_MAP_GEN_FSO_FILE", "OBJECT_ID_MAP_GEN_FSO_DIR"})
+ void testInProgressWithMapGenSubStatusIncludesProgress(SubStatus subStatus) {
SnapshotDiffResponse response = new SnapshotDiffResponse(createReport(),
JobStatus.IN_PROGRESS, 1000L, true);
- response.setSubStatus(SubStatus.OBJECT_ID_MAP_GEN_OBS);
+ response.setSubStatus(subStatus);
response.setProgressPercent(55.5);
String message = response.toString();
assertTrue(message.contains("IN_PROGRESS"));
- assertTrue(message.contains("OBJECT_ID_MAP_GEN_OBS"));
+ assertTrue(message.contains(subStatus.name()));
assertTrue(message.contains("Keys Processed Estimated Percentage"));
assertTrue(message.contains("55.5"));
}
+ @ParameterizedTest
+ @EnumSource(value = SubStatus.class,
+ names = {"OBJECT_ID_MAP_GEN_OBS", "OBJECT_ID_MAP_GEN_FSO",
"OBJECT_ID_MAP_GEN_FSO_FILE",
+ "OBJECT_ID_MAP_GEN_FSO_DIR"},
+ mode = Mode.EXCLUDE)
+ void
testInProgressWithNonMapGenSubStatusRendersSubStatusButNotProgress(SubStatus
subStatus) {
Review Comment:
nit: Could you keep the test names short and maybe add comments for the
description. Just so it is easier to read.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]