use of com.sequenceiq.cloudbreak.client.RPCMessage 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.sequenceiq.cloudbreak.client.RPCMessage in project cloudbreak by hortonworks.
the class ServerConnCheckFreeipaRpcResponse method unreachable.
public static ServerConnCheckFreeipaRpcResponse unreachable() {
RPCMessage rpcMessage = new RPCMessage();
rpcMessage.setMessage("Unreachable mock");
return new ServerConnCheckFreeipaRpcResponse(false, List.of(rpcMessage));
}
use of com.sequenceiq.cloudbreak.client.RPCMessage in project cloudbreak by hortonworks.
the class FreeIpaHealthCheckClient method toRpcResponse.
private <T> RPCResponse<T> toRpcResponse(String name, Response response, Class<T> resultType) {
T resultResponse = response.readEntity(resultType);
RPCResponse<T> rpcResponse = new RPCResponse<>();
RPCMessage rpcMessage = new RPCMessage();
rpcMessage.setName(name);
rpcMessage.setCode(response.getStatus());
rpcMessage.setMessage(response.readEntity(String.class));
rpcResponse.setSummary(name);
rpcResponse.setMessages(List.of(rpcMessage));
rpcResponse.setResult(resultResponse);
rpcResponse.setCount(1);
rpcResponse.setTruncated(Boolean.FALSE);
return rpcResponse;
}
use of com.sequenceiq.cloudbreak.client.RPCMessage in project cloudbreak by hortonworks.
the class FreeIpaInstanceHealthDetailsServiceTest method getErrorPayloadWithMixedResults.
private RPCResponse<CheckResult> getErrorPayloadWithMixedResults(String host) {
CheckResult checkResult = new CheckResult();
checkResult.setHost(host);
CheckEntry healthy = new CheckEntry();
healthy.setStatus("HEALTHY");
healthy.setCheckId("hId");
healthy.setPlugin("good");
CheckEntry unhealthy = new CheckEntry();
unhealthy.setStatus("UNHEALTHY");
unhealthy.setCheckId("unhId");
unhealthy.setPlugin("bad");
checkResult.setChecks(List.of(healthy, unhealthy));
PluginStatusEntry healthyPlugin = new PluginStatusEntry();
healthyPlugin.setPlugin("healthyPlugin");
healthyPlugin.setStatus("HEALTHY");
healthyPlugin.setHost(host);
PluginStatusEntry unhealthyPlugin = new PluginStatusEntry();
unhealthyPlugin.setPlugin("unhealthyPlugin");
unhealthyPlugin.setStatus("UNHEALTHY");
unhealthyPlugin.setHost(host);
checkResult.setPluginStats(List.of(healthyPlugin, unhealthyPlugin));
RPCResponse<CheckResult> badResponse;
badResponse = new RPCResponse<>();
badResponse.setResult(checkResult);
RPCMessage message = new RPCMessage();
message.setCode(503);
message.setMessage(JsonUtil.writeValueAsStringSilentSafe(checkResult));
badResponse.setMessages(List.of(message));
return badResponse;
}
use of com.sequenceiq.cloudbreak.client.RPCMessage in project cloudbreak by hortonworks.
the class FreeIpaInstanceHealthDetailsServiceTest method newLegacyRPCMessage.
private RPCMessage newLegacyRPCMessage(String message) {
RPCMessage msg = new RPCMessage();
msg.setMessage(message);
msg.setName("ExternalCommandOutput");
return msg;
}
Aggregations