@Test(dataProvider = "allCombinationShouldWeCapture")
public void checkForCorrectLogging(Level givenMinimumLevel, Level logThisLevel, Boolean shouldCapture) {
Log4JLoggingHook hook = new Log4JLoggingHook(platformManager, givenMinimumLevel.toString());
long methodId = 1l;
long sensorTypeId = 3l;
long platformId = 9l;
when(platformManager.getPlatformId()).thenReturn(platformId);
String loggingMessage = "a logging message";
Object[] params = new Object[4];
params[0] = "fqcn";
params[1] = logThisLevel;
params[2] = loggingMessage;
params[3] = null;
hook.secondAfterBody(coreService, methodId, sensorTypeId, null, params, null, false, rsc);
LoggingData loggingData = new LoggingData(logThisLevel.toString(), loggingMessage);
loggingData.setMethodIdent(methodId);
loggingData.setSensorTypeIdent(sensorTypeId);
loggingData.setPlatformIdent(platformId);
if (shouldCapture) {
verify(coreService).addDefaultData(argThat(new LoggingDataVerifier(loggingData)));
} else {
verify(coreService, never()).addDefaultData(Mockito.<DefaultData> any());
}
}