mattyb149 commented on a change in pull request #5041:
URL: https://github.com/apache/nifi/pull/5041#discussion_r622683446



##########
File path: 
minifi/minifi-bootstrap/src/test/java/org/apache/nifi/minifi/bootstrap/status/reporters/StatusLoggerTest.java
##########
@@ -194,16 +209,81 @@ public void TestErrorException() throws IOException {
         
Mockito.when(queryableStatusAggregator.statusReport(MOCK_QUERY)).thenThrow(ioException);
 
         statusLogger.initialize(getProperties(LogLevel.ERROR), 
queryableStatusAggregator);
+        statusLogger.setScheduledExecutorService(new 
RunOnceScheduledExecutorService());
         statusLogger.start();
 
         verify(logger, 
Mockito.timeout(300).atLeastOnce()).error(ENCOUNTERED_IO_EXCEPTION, 
ioException);
     }
 
-    private static Properties getProperties(LogLevel logLevel){
+    private static Properties getProperties(LogLevel logLevel) {
         Properties properties = new Properties();
-        properties.setProperty(REPORT_PERIOD_KEY, "100");
+        properties.setProperty(REPORT_PERIOD_KEY, "1");
         properties.setProperty(LOGGING_LEVEL_KEY, logLevel.name());
         properties.setProperty(QUERY_KEY, MOCK_QUERY);
         return properties;
     }
+
+    private static class RunOnceScheduledExecutorService extends 
AbstractExecutorService implements ScheduledExecutorService {

Review comment:
       That sounds good, will change thanks!

##########
File path: 
minifi/minifi-bootstrap/src/test/java/org/apache/nifi/minifi/bootstrap/status/reporters/StatusLoggerTest.java
##########
@@ -101,14 +107,16 @@ public void testFailedInitDueToNoQuery(){
     @Test
     public void TestTrace() {
         statusLogger.initialize(getProperties(LogLevel.TRACE), 
queryableStatusAggregator);
+        statusLogger.setScheduledExecutorService(new 
RunOnceScheduledExecutorService());
         statusLogger.start();
 
-        verify(logger, Mockito.timeout(300).atLeastOnce()).info(MOCK_STATUS, 
(Throwable) null);
+        verify(logger, Mockito.timeout(300).atLeastOnce()).trace(MOCK_STATUS, 
(Throwable) null);

Review comment:
       Yeah would like to do that, it's a moot point now anyway




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