Commit bbae7bf0 authored by Kelly Domico's avatar Kelly Domico
Browse files

Add doNothing to CoreLoggerTest

parent 55a2150e
Pipeline #19036 failed with stages
in 18 seconds
......@@ -45,24 +45,28 @@ public class CoreLoggerTest {
@Test
public void testInfoWithMessage() {
doNothing().when(spySlf4jLogger).info(eq(LOG_MESSAGE));
coreLogger.info(LOG_MESSAGE);
verify(spySlf4jLogger).info(LOG_MESSAGE);
}
@Test
public void testInfoWithArguments() {
doNothing().when(spySlf4jLogger).info(eq("{} {} {}"), eq(ARG1), eq(ARG2), eq(ARG3));
coreLogger.info("{} {} {}", ARG1, ARG2, ARG3);
verify(spySlf4jLogger).info("{} {} {}", ARG1, ARG2, ARG3);
}
@Test
public void testWarnWithMessage() {
doNothing().when(spySlf4jLogger).warn(eq(LOG_MESSAGE));
coreLogger.warn(LOG_MESSAGE);
verify(spySlf4jLogger).warn(LOG_MESSAGE);
}
@Test
public void testWarnWithArguments() {
doNothing().when(spySlf4jLogger).warn(eq("{} {} {}"), eq(ARG1), eq(ARG2), eq(ARG3));
coreLogger.warn("{} {} {}", ARG1, ARG2, ARG3);
verify(spySlf4jLogger).warn("{} {} {}", ARG1, ARG2, ARG3);
}
......@@ -71,18 +75,21 @@ public class CoreLoggerTest {
public void testWarnWithThrowable() {
Exception e = new Exception(EXCEPTION_MESSAGE);
doNothing().when(spySlf4jLogger).warn(eq(LOG_MESSAGE), eq(e));
coreLogger.warn(LOG_MESSAGE, e);
verify(spySlf4jLogger).warn(LOG_MESSAGE, e);
}
@Test
public void testErrorWithMessage() {
doNothing().when(spySlf4jLogger).error(eq(LOG_MESSAGE));
coreLogger.error(LOG_MESSAGE);
verify(spySlf4jLogger).error(LOG_MESSAGE);
}
@Test
public void testErrorWithArguments() {
doNothing().when(spySlf4jLogger).error(eq("{} {} {}"), eq(ARG1), eq(ARG2), eq(ARG3));
coreLogger.error("{} {} {}", ARG1, ARG2, ARG3);
verify(spySlf4jLogger).error("{} {} {}", ARG1, ARG2, ARG3);
}
......@@ -91,12 +98,14 @@ public class CoreLoggerTest {
public void testErrorWithThrowable() {
Exception e = new Exception(EXCEPTION_MESSAGE);
doNothing().when(spySlf4jLogger).error(eq(LOG_MESSAGE), eq(e));
coreLogger.error(LOG_MESSAGE, e);
verify(spySlf4jLogger).error(LOG_MESSAGE, e);
}
@Test
public void testLogAudit() {
doNothing().when(spySlf4jLogger).info(anyString(), (Object) any());
List<String> resource = new ArrayList<>();
resource.add("TestResource");
AuditPayload payload = AuditPayload.builder()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment