use of org.apache.nifi.minifi.commons.status.FlowStatusReport in project nifi-minifi by apache.
the class StatusConfigReporterTest method controllerServiceStatusAll.
@Test
public void controllerServiceStatusAll() throws Exception {
populateControllerService(true, true);
String statusRequest = "controllerServices:bulletins, health";
FlowStatusReport actual = StatusConfigReporter.getStatus(mockFlowController, statusRequest, LoggerFactory.getLogger(StatusConfigReporterTest.class));
FlowStatusReport expected = new FlowStatusReport();
expected.setErrorsGeneratingReport(Collections.EMPTY_LIST);
addControllerServiceStatus(expected, true, true, true, true);
assertEquals(expected, actual);
}
use of org.apache.nifi.minifi.commons.status.FlowStatusReport in project nifi-minifi by apache.
the class StatusConfigReporterTest method systemDiagnosticGarbageCollection.
@Test
public void systemDiagnosticGarbageCollection() throws Exception {
populateSystemDiagnostics();
String statusRequest = "systemDiagnostics:garbagecollection";
FlowStatusReport actual = StatusConfigReporter.getStatus(mockFlowController, statusRequest, LoggerFactory.getLogger(StatusConfigReporterTest.class));
FlowStatusReport expected = new FlowStatusReport();
expected.setErrorsGeneratingReport(Collections.EMPTY_LIST);
addSystemDiagnosticStatus(expected, false, false, false, false, true);
assertEquals(expected, actual);
}
use of org.apache.nifi.minifi.commons.status.FlowStatusReport in project nifi-minifi by apache.
the class StatusConfigReporterTest method remoteProcessGroupStatusOutputPorts.
@Test
public void remoteProcessGroupStatusOutputPorts() throws Exception {
populateRemoteProcessGroup(false, false);
String statusRequest = "remoteProcessGroup:all:outputPorts";
FlowStatusReport actual = StatusConfigReporter.getStatus(mockFlowController, statusRequest, LoggerFactory.getLogger(StatusConfigReporterTest.class));
FlowStatusReport expected = new FlowStatusReport();
expected.setErrorsGeneratingReport(Collections.EMPTY_LIST);
addExpectedRemoteProcessGroupStatus(expected, false, false, true, false, false, false);
assertEquals(expected, actual);
}
use of org.apache.nifi.minifi.commons.status.FlowStatusReport 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