gargvishesh commented on code in PR #17033:
URL: https://github.com/apache/druid/pull/17033#discussion_r1771302337
##########
indexing-service/src/test/java/org/apache/druid/indexing/compact/CompactionSupervisorSpecTest.java:
##########
@@ -82,20 +82,32 @@ public void testSerdeOfSuspendedSpec()
}
@Test
- public void testInvalidSpecThrowsException()
+ public void testSupervisorWithInvalidSpecThrowsExceptionForStatus()
{
Mockito.when(scheduler.validateCompactionConfig(ArgumentMatchers.any()))
.thenReturn(CompactionConfigValidationResult.failure("bad spec"));
final DruidException exception = Assert.assertThrows(
DruidException.class,
- () -> new CompactionSupervisorSpec(null, false, scheduler)
+ () -> new CompactionSupervisorSpec(
+ new
DataSourceCompactionConfig.Builder().forDataSource("datasource").build(),
+ false,
+ scheduler
+ ).createSupervisor().getStatus()
);
Assert.assertEquals(
- "Compaction supervisor 'spec' is invalid. Reason[bad spec].",
+ "Compaction supervisor spec is invalid. Reason[bad spec].",
exception.getMessage()
);
}
+ @Test
+ public void testInvalidSpecReturnsInvalid()
+ {
+ Mockito.when(scheduler.validateCompactionConfig(ArgumentMatchers.any()))
+ .thenReturn(CompactionConfigValidationResult.failure("bad spec"));
+ Assert.assertFalse(new CompactionSupervisorSpec(null, false,
scheduler).getValidationResult().isValid());
Review Comment:
Added the message check.
##########
indexing-service/src/test/java/org/apache/druid/indexing/compact/CompactionSupervisorSpecTest.java:
##########
@@ -82,20 +82,32 @@ public void testSerdeOfSuspendedSpec()
}
@Test
- public void testInvalidSpecThrowsException()
+ public void testSupervisorWithInvalidSpecThrowsExceptionForStatus()
Review Comment:
Updated.
--
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]