adoroszlai commented on code in PR #9316:
URL: https://github.com/apache/ozone/pull/9316#discussion_r2538940204
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/stream/TestDirstreamClientHandler.java:
##########
@@ -113,6 +118,32 @@ public void splitContent() throws IOException {
assertEquals("yyy", getContent("bsd.txt"));
}
+ @ParameterizedTest(name = "Invalid format: {0}")
+ @MethodSource("provideInvalidFormatTestCases")
+ public void testInvalidFormat(String testCaseName, String invalidInput) {
+ final DirstreamClientHandler handler = new DirstreamClientHandler(
+ new DirectoryServerDestination(tmpDir));
+
+ IllegalArgumentException exception =
assertThrows(IllegalArgumentException.class, () -> {
+ handler.doRead(null, wrap(invalidInput));
+ });
+ assertTrue(exception.getMessage().contains("Invalid file name format"),
Review Comment:
Please use `assertThat(exception).hasMessageContaining(...)` instead of
`assertTrue(exception.getMessage().contains(...))`. The latter does not
provide any information about the actual message if the assertion fails.
--
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]