adoroszlai commented on code in PR #5862:
URL: https://github.com/apache/ozone/pull/5862#discussion_r1436371115
##########
hadoop-hdds/framework/src/test/java/org/apache/hadoop/ozone/audit/TestOzoneAuditLogger.java:
##########
@@ -183,11 +183,11 @@ public void verifyDefaultLogLevelForAuthFailure() throws
IOException {
@Test
public void messageIncludesAllParts() {
String message = WRITE_FAIL_MSG.getFormattedMessage();
- assertTrue(message.contains(USER), message);
- assertTrue(message.contains(IP_ADDRESS), message);
- assertTrue(message.contains(DummyAction.CREATE_VOLUME.name()), message);
- assertTrue(message.contains(PARAMS.toString()), message);
- assertTrue(message.contains(FAILURE.getStatus()), message);
+ assertThat(message).withFailMessage(message).contains(USER);
+ assertThat(message).withFailMessage(message).contains(IP_ADDRESS);
+
assertThat(message).withFailMessage(message).contains(DummyAction.CREATE_VOLUME.name());
+ assertThat(message).withFailMessage(message).contains(PARAMS.toString());
+ assertThat(message).withFailMessage(message).contains(FAILURE.getStatus());
Review Comment:
I'd remove two kinds:
* where the string itself is passed (like here)
* message similar to "expected: ..., got: ..."
We can keep the rest.
--
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]