Search in sources :

Example 16 with UpscaleFailureEvent

use of com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent in project cloudbreak by hortonworks.

the class ValidateInstancesHealthHandlerTest method testDefaultFailureEvent.

@Test
public void testDefaultFailureEvent() {
    Exception e = new Exception("puff");
    Event<ValidateInstancesHealthEvent> event = new Event<>(new ValidateInstancesHealthEvent(3L, List.of()));
    UpscaleFailureEvent result = (UpscaleFailureEvent) underTest.defaultFailureEvent(2L, e, event);
    assertEquals(e, result.getException());
    assertEquals(2L, result.getResourceId());
    assertEquals(PHASE, result.getFailedPhase());
}
Also used : UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent) UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent) Event(reactor.bus.Event) StackEvent(com.sequenceiq.freeipa.flow.stack.StackEvent) ValidateInstancesHealthEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.ValidateInstancesHealthEvent) HandlerEvent(com.sequenceiq.flow.reactor.api.handler.HandlerEvent) ValidateInstancesHealthEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.ValidateInstancesHealthEvent) FreeIpaClientException(com.sequenceiq.freeipa.client.FreeIpaClientException) Test(org.junit.jupiter.api.Test)

Aggregations

UpscaleFailureEvent (com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)16 Stack (com.sequenceiq.freeipa.entity.Stack)7 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)5 StackContext (com.sequenceiq.freeipa.flow.stack.StackContext)5 StackEvent (com.sequenceiq.freeipa.flow.stack.StackEvent)5 Map (java.util.Map)5 Bean (org.springframework.context.annotation.Bean)5 OperationException (com.sequenceiq.cloudbreak.service.OperationException)4 InstanceMetaData (com.sequenceiq.freeipa.entity.InstanceMetaData)4 ValidateInstancesHealthEvent (com.sequenceiq.freeipa.flow.freeipa.upscale.event.ValidateInstancesHealthEvent)4 ClientErrorException (javax.ws.rs.ClientErrorException)4 FreeIpaClientException (com.sequenceiq.freeipa.client.FreeIpaClientException)3 CollectMetadataResult (com.sequenceiq.cloudbreak.cloud.event.instance.CollectMetadataResult)2 WebApplicationExceptionMessageExtractor (com.sequenceiq.cloudbreak.common.exception.WebApplicationExceptionMessageExtractor)2 EnvironmentEndpoint (com.sequenceiq.environment.api.v1.environment.endpoint.EnvironmentEndpoint)2 Flow (com.sequenceiq.flow.core.Flow)2 FlowParameters (com.sequenceiq.flow.core.FlowParameters)2 HandlerEvent (com.sequenceiq.flow.reactor.api.handler.HandlerEvent)2 FailureDetails (com.sequenceiq.freeipa.api.v1.freeipa.user.model.FailureDetails)2 SuccessDetails (com.sequenceiq.freeipa.api.v1.freeipa.user.model.SuccessDetails)2