use of com.sequenceiq.common.model.diagnostics.DiagnosticParameters in project cloudbreak by hortonworks.
the class DiagnosticsSaltValidationHandlerTest method testDoAccept.
@Test
public void testDoAccept() throws CloudbreakOrchestratorFailedException {
// GIVEN
given(diagnosticsOperationsService.applyUnresponsiveHosts(anyLong(), any())).willReturn(new DiagnosticParameters());
// WHEN
DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(SALT_VALIDATION_DIAGNOSTICS_EVENT.selector(), STACK_ID, "crn", new DiagnosticParameters());
underTest.doAccept(new HandlerEvent<>(new Event<>(event)));
// THEN
verify(diagnosticsOperationsService, times(1)).applyUnresponsiveHosts(anyLong(), any());
}
use of com.sequenceiq.common.model.diagnostics.DiagnosticParameters in project cloudbreak by hortonworks.
the class DiagnosticsOperationsServiceTest method applyUnresponsiveNodesCheckWithSkipUnresponsiveNodes.
@Test
public void applyUnresponsiveNodesCheckWithSkipUnresponsiveNodes() throws Exception {
// GIVEN
given(orchestratorMetadataProvider.getOrchestratorMetadata(STACK_ID)).willReturn(metadata);
given(metadata.getNodes()).willReturn(nodes());
given(telemetryOrchestrator.collectUnresponsiveNodes(anyList(), anySet(), any())).willReturn(nodes());
DiagnosticParameters params = diagnosticParameters(DiagnosticsDestination.SUPPORT);
params.setSkipUnresponsiveHosts(true);
// WHEN
DiagnosticParameters result = underTest.applyUnresponsiveHosts(STACK_ID, params);
// THEN
assertTrue(result.getExcludeHosts().contains("host1"));
}
Aggregations