use of org.apache.nifi.minifi.bootstrap.QueryableStatusAggregator in project nifi-minifi by apache.
the class StatusLoggerTest method init.
@Before
public void init() throws IOException, NoSuchFieldException, IllegalAccessException {
statusLogger = Mockito.spy(new StatusLogger());
logger = Mockito.mock(Logger.class);
queryableStatusAggregator = Mockito.mock(QueryableStatusAggregator.class);
flowStatusReport = Mockito.mock(FlowStatusReport.class);
Mockito.when(flowStatusReport.toString()).thenReturn(MOCK_STATUS);
Field field = StatusLogger.class.getDeclaredField("logger");
field.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
field.set(null, logger);
Mockito.when(queryableStatusAggregator.statusReport(MOCK_QUERY)).thenReturn(flowStatusReport);
}
Aggregations