use of com.cloudera.thunderhead.telemetry.nodestatus.NodeStatusProto.NodeStatusReport in project cloudbreak by hortonworks.
the class NetworkCheckerConclusionStepTest method checkShouldBeSuccessfulIfNetworkReportIsNullForOlderImageVersions.
@Test
public void checkShouldBeSuccessfulIfNetworkReportIsNullForOlderImageVersions() {
RPCResponse<NodeStatusReport> response = new RPCResponse<>();
RPCMessage message = new RPCMessage();
message.setMessage("rpc response");
response.setMessages(List.of(message));
when(nodeStatusService.getNetworkReport(eq(1L))).thenReturn(response);
Conclusion stepResult = underTest.check(1L);
assertFalse(stepResult.isFailureFound());
assertNull(stepResult.getConclusion());
assertNull(stepResult.getDetails());
assertEquals(NetworkCheckerConclusionStep.class, stepResult.getConclusionStepClass());
verify(nodeStatusService, times(1)).getNetworkReport(eq(1L));
}
use of com.cloudera.thunderhead.telemetry.nodestatus.NodeStatusProto.NodeStatusReport in project cloudbreak by hortonworks.
the class NetworkCheckerConclusionStepTest method createNetworkReportResponse.
private RPCResponse<NodeStatusReport> createNetworkReportResponse(NetworkDetails networkDetails) {
StatusDetails statusDetails = StatusDetails.newBuilder().setHost("host1").build();
NodeStatus nodeStatus = NodeStatus.newBuilder().setStatusDetails(statusDetails).setNetworkDetails(networkDetails).build();
NodeStatusReport nodeStatusReport = NodeStatusReport.newBuilder().addNodes(nodeStatus).build();
RPCResponse<NodeStatusReport> response = new RPCResponse<>();
response.setResult(nodeStatusReport);
return response;
}
use of com.cloudera.thunderhead.telemetry.nodestatus.NodeStatusProto.NodeStatusReport in project cloudbreak by hortonworks.
the class NodeServicesCheckerConclusionStepTest method createNodeStatusResponse.
private RPCResponse<NodeStatusReport> createNodeStatusResponse(HealthStatus saltBootstrapServiceStatus) {
StatusDetails statusDetails = StatusDetails.newBuilder().setHost("host1").build();
ServiceStatus serviceStatus = ServiceStatus.newBuilder().setName("salt-bootstrap").setStatus(saltBootstrapServiceStatus).build();
ServicesDetails servicesDetails = ServicesDetails.newBuilder().addInfraServices(serviceStatus).build();
NodeStatus nodeStatus = NodeStatus.newBuilder().setStatusDetails(statusDetails).setServicesDetails(servicesDetails).build();
NodeStatusReport nodeStatusReport = NodeStatusReport.newBuilder().addNodes(nodeStatus).build();
RPCResponse<NodeStatusReport> response = new RPCResponse<>();
response.setResult(nodeStatusReport);
return response;
}
use of com.cloudera.thunderhead.telemetry.nodestatus.NodeStatusProto.NodeStatusReport in project cloudbreak by hortonworks.
the class NodeServicesCheckerConclusionStepTest method checkShouldBeSuccessfulIfNodeStatusReportIsNullForOlderImageVersions.
@Test
public void checkShouldBeSuccessfulIfNodeStatusReportIsNullForOlderImageVersions() {
RPCResponse<NodeStatusReport> response = new RPCResponse<>();
RPCMessage message = new RPCMessage();
message.setMessage("rpc response");
response.setMessages(List.of(message));
when(nodeStatusService.getServicesReport(eq(1L))).thenReturn(response);
Conclusion stepResult = underTest.check(1L);
assertFalse(stepResult.isFailureFound());
assertNull(stepResult.getConclusion());
assertNull(stepResult.getDetails());
assertEquals(NodeServicesCheckerConclusionStep.class, stepResult.getConclusionStepClass());
verify(nodeStatusService, times(1)).getServicesReport(eq(1L));
}
Aggregations