use of com.emc.storageos.systemservices.impl.resource.HealthMonitorService in project coprhd-controller by CoprHD.
the class DiagnosticsExecTest method testNodeDiagnostics.
@Test
public void testNodeDiagnostics() {
HealthMonitorService healthMonitorService = new HealthMonitorService();
DiagnosticsRestRep resp = healthMonitorService.getDiagnostics(null, "1", null);
Assert.assertNotNull(resp);
Assert.assertNotNull(resp.getNodeDiagnosticsList());
Set<String> testNames = new HashSet<String>();
for (NodeDiagnostics diag : resp.getNodeDiagnosticsList()) {
Assert.assertTrue(diag.getNodeId() != null && !diag.getNodeId().isEmpty());
Assert.assertTrue(diag.getIp() != null && !diag.getIp().isEmpty());
Assert.assertNotNull(diag.getDiagTests());
for (DiagTest test : diag.getDiagTests()) {
testNames.add(test.getName());
Assert.assertTrue(test.getStatus() != null && !test.getStatus().isEmpty());
if (test.getTestParams() != null) {
for (TestParam param : test.getTestParams()) {
Assert.assertTrue(param.getKey() != null && !param.getKey().isEmpty());
Assert.assertTrue(param.getValue() != null && !param.getValue().isEmpty());
}
}
}
Assert.assertTrue(testNames.containsAll(DIAG_TESTS));
}
}
Aggregations