NIFI-7387: update ComponentLog API to accept Object varargs instead of array

This closes #4225.

Signed-off-by: Mark Payne <markap14@hotmail.com>
This commit is contained in:
Mark Bean 2020-04-22 17:17:09 +00:00 committed by Mark Payne
parent 8b2712e537
commit 954c09d0c3
2 changed files with 6 additions and 9 deletions

View File

@ -52,7 +52,7 @@ public interface ComponentLog {
void warn(String msg, Throwable t); void warn(String msg, Throwable t);
void warn(String msg, Object[] os); void warn(String msg, Object... os);
void warn(String msg, Object[] os, Throwable t); void warn(String msg, Object[] os, Throwable t);
@ -60,7 +60,7 @@ public interface ComponentLog {
void trace(String msg, Throwable t); void trace(String msg, Throwable t);
void trace(String msg, Object[] os); void trace(String msg, Object... os);
void trace(String msg); void trace(String msg);
@ -78,7 +78,7 @@ public interface ComponentLog {
void info(String msg, Throwable t); void info(String msg, Throwable t);
void info(String msg, Object[] os); void info(String msg, Object... os);
void info(String msg); void info(String msg);
@ -88,7 +88,7 @@ public interface ComponentLog {
void error(String msg, Throwable t); void error(String msg, Throwable t);
void error(String msg, Object[] os); void error(String msg, Object... os);
void error(String msg); void error(String msg);
@ -96,7 +96,7 @@ public interface ComponentLog {
void debug(String msg, Throwable t); void debug(String msg, Throwable t);
void debug(String msg, Object[] os); void debug(String msg, Object... os);
void debug(String msg, Object[] os, Throwable t); void debug(String msg, Object[] os, Throwable t);
@ -104,7 +104,7 @@ public interface ComponentLog {
void log(LogLevel level, String msg, Throwable t); void log(LogLevel level, String msg, Throwable t);
void log(LogLevel level, String msg, Object[] os); void log(LogLevel level, String msg, Object... os);
void log(LogLevel level, String msg); void log(LogLevel level, String msg);

View File

@ -20,9 +20,7 @@ package org.apache.nifi.processors.evtx;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.any; import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.eq; import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.isA;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.verifyNoMoreInteractions;
@ -144,7 +142,6 @@ public class ParseEvtxTest {
when(flowFile.getAttribute(CoreAttributes.FILENAME.key())).thenReturn(basename); when(flowFile.getAttribute(CoreAttributes.FILENAME.key())).thenReturn(basename);
assertEquals(basename, parseEvtx.getBasename(flowFile, componentLog)); assertEquals(basename, parseEvtx.getBasename(flowFile, componentLog));
verify(componentLog).warn(anyString(), isA(Object[].class));
} }
@Test @Test