carterkozak commented on a change in pull request #468:
URL: https://github.com/apache/logging-log4j2/pull/468#discussion_r579683174



##########
File path: log4j-1.2-api/src/test/java/org/apache/log4j/CategoryTest.java
##########
@@ -78,23 +78,23 @@ public void testForcedLog() {
         category.info("Hello, World");
         final List<LogEvent> list = appender.getEvents();
         int events = list.size();
-        assertTrue("Number of events should be 1, was " + events, events == 1);
+        assertThat(events).describedAs("Number of events should be 1, was " + 
events).isEqualTo(1);
         LogEvent event = list.get(0);
         Message msg = event.getMessage();
-        assertNotNull("No message", msg);
-        assertTrue("Incorrect Message type", msg instanceof ObjectMessage);
+        assertThat(msg).describedAs("No message").isNotNull();
+        assertThat(msg instanceof ObjectMessage).describedAs("Incorrect 
Message type").isTrue();
         Object[] objects = msg.getParameters();
-        assertTrue("Incorrect Object type", objects[0] instanceof String);
+        assertThat(objects[0] instanceof String).describedAs("Incorrect Object 
type").isTrue();
         appender.clear();
         category.log(Priority.INFO, "Hello, World");
         events = list.size();
-        assertTrue("Number of events should be 1, was " + events, events == 1);
+        assertThat(events).describedAs("Number of events should be 1, was " + 
events).isEqualTo(1);
         event = list.get(0);
         msg = event.getMessage();
-        assertNotNull("No message", msg);
-        assertTrue("Incorrect Message type", msg instanceof ObjectMessage);
+        assertThat(msg).describedAs("No message").isNotNull();
+        assertThat(msg instanceof ObjectMessage).describedAs("Incorrect 
Message type").isTrue();

Review comment:
       I should have probably used “as” instead of “describedAs”, they do the 
exact same thing but the former is nine characters shorter.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to