mmiklavc commented on a change in pull request #1554: METRON-2307: Migrate to
JUnit5
URL: https://github.com/apache/metron/pull/1554#discussion_r346974980
##########
File path:
metron-platform/metron-common/src/test/java/org/apache/metron/common/performance/PerformanceLoggerTest.java
##########
@@ -62,29 +57,29 @@ public void setup() {
}
@Test
- public void logs_on_threshold() throws Exception {
+ public void logs_on_threshold() {
when(timing.getElapsed("t1")).thenReturn(111L).thenReturn(222L).thenReturn(333L);
perfLogger.mark("t1");
perfLogger.log("t1");
perfLogger.log("t1");
perfLogger.log("t1");
verify(timing).mark("t1");
- verify(logger, times(1)).debug(anyString(), anyObject(), eq(111L), eq(""));
+ verify(logger, times(1)).debug(any(String.class), any(), eq(111L), eq(""));
}
@Test
- public void logs_on_threshold_with_message() throws Exception {
+ public void logs_on_threshold_with_message() {
when(timing.getElapsed("t1")).thenReturn(111L).thenReturn(222L).thenReturn(333L);
perfLogger.mark("t1");
perfLogger.log("t1", "my message");
perfLogger.log("t1", "my message");
perfLogger.log("t1", "my message");
verify(timing).mark("t1");
- verify(logger, times(1)).debug(anyString(), anyObject(), eq(111L), eq("my
message"));
+ verify(logger, times(1)).debug(any(String.class), any(), eq(111L), eq("my
message"));
Review comment:
Agreed on swapping `any()` for `anyObject()` per the javadoc. Why'd you take
out `anyString()`? It also checks for non-null (which is what we want).
----------------------------------------------------------------
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]
With regards,
Apache Git Services