Search in sources :

Example 1 with BaseNamedFlowEvent

use of com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent in project cloudbreak by hortonworks.

the class PublicKeyCreationHandlerTest method verifyEnvCreationEvent.

private void verifyEnvCreationEvent() {
    BaseNamedFlowEvent event = baseNamedFlowEvent.getValue();
    assertThat(event).isInstanceOf(EnvCreationEvent.class);
    EnvCreationEvent envCreationEvent = (EnvCreationEvent) event;
    assertThat(envCreationEvent.getResourceName()).isEqualTo(ENVIRONMENT_NAME);
    assertThat(envCreationEvent.getResourceCrn()).isEqualTo(ENVIRONMENT_CRN);
    assertThat(envCreationEvent.getResourceId()).isEqualTo(ENVIRONMENT_ID);
    assertThat(envCreationEvent.selector()).isEqualTo(START_ENVIRONMENT_RESOURCE_ENCRYPTION_INITIALIZATION_EVENT.selector());
    assertThat(headersArgumentCaptor.getValue()).isSameAs(headers);
}
Also used : BaseNamedFlowEvent(com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent) EnvCreationEvent(com.sequenceiq.environment.environment.flow.creation.event.EnvCreationEvent)

Example 2 with BaseNamedFlowEvent

use of com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent in project cloudbreak by hortonworks.

the class ClusterDefinitionDeleteHandlerTest method verifyEnvDeleteEvent.

private void verifyEnvDeleteEvent() {
    BaseNamedFlowEvent event = baseNamedFlowEventCaptor.getValue();
    assertThat(event).isInstanceOf(EnvDeleteEvent.class);
    EnvDeleteEvent envDeleteEvent = (EnvDeleteEvent) event;
    assertThat(envDeleteEvent.getResourceName()).isEqualTo(ENVIRONMENT_NAME);
    assertThat(envDeleteEvent.getResourceCrn()).isEqualTo(ENVIRONMENT_CRN);
    assertThat(envDeleteEvent.getResourceId()).isEqualTo(ENVIRONMENT_ID);
    assertThat(envDeleteEvent.selector()).isEqualTo(START_UMS_RESOURCE_DELETE_EVENT.selector());
    assertThat(headersArgumentCaptor.getValue()).isSameAs(headers);
}
Also used : BaseNamedFlowEvent(com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent) EnvDeleteEvent(com.sequenceiq.environment.environment.flow.deletion.event.EnvDeleteEvent)

Example 3 with BaseNamedFlowEvent

use of com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent in project cloudbreak by hortonworks.

the class IdBrokerMappingsDeleteHandlerTest method verifyEnvDeleteFailedEvent.

private void verifyEnvDeleteFailedEvent(Exception exceptionExpected) {
    BaseNamedFlowEvent event = eventArgumentCaptor.getValue();
    assertThat(event).isInstanceOf(EnvDeleteFailedEvent.class);
    EnvDeleteFailedEvent envDeleteFailedEvent = (EnvDeleteFailedEvent) event;
    assertThat(envDeleteFailedEvent.getResourceName()).isEqualTo(ENVIRONMENT_NAME);
    assertThat(envDeleteFailedEvent.getResourceCrn()).isEqualTo(ENVIRONMENT_CRN);
    assertThat(envDeleteFailedEvent.getResourceId()).isEqualTo(ENVIRONMENT_ID);
    assertThat(envDeleteFailedEvent.selector()).isEqualTo(FAILED_ENV_DELETE_EVENT.selector());
    assertThat(envDeleteFailedEvent.getException()).isSameAs(exceptionExpected);
    assertThat(headersArgumentCaptor.getValue()).isSameAs(headers);
}
Also used : BaseNamedFlowEvent(com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent) EnvDeleteFailedEvent(com.sequenceiq.environment.environment.flow.deletion.event.EnvDeleteFailedEvent)

Example 4 with BaseNamedFlowEvent

use of com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent in project cloudbreak by hortonworks.

the class S3GuardTableDeleteHandlerTest method verifyEnvDeleteFailedEvent.

private void verifyEnvDeleteFailedEvent(Exception exceptionExpected) {
    BaseNamedFlowEvent event = eventArgumentCaptor.getValue();
    assertThat(event).isInstanceOf(EnvDeleteFailedEvent.class);
    EnvDeleteFailedEvent envDeleteFailedEvent = (EnvDeleteFailedEvent) event;
    assertThat(envDeleteFailedEvent.getResourceName()).isEqualTo(ENVIRONMENT_NAME);
    assertThat(envDeleteFailedEvent.getResourceCrn()).isEqualTo(ENVIRONMENT_CRN);
    assertThat(envDeleteFailedEvent.getResourceId()).isEqualTo(ENVIRONMENT_ID);
    assertThat(envDeleteFailedEvent.selector()).isEqualTo(FAILED_ENV_DELETE_EVENT.selector());
    assertThat(envDeleteFailedEvent.getException()).isSameAs(exceptionExpected);
    assertThat(headersArgumentCaptor.getValue()).isSameAs(headers);
}
Also used : BaseNamedFlowEvent(com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent) EnvDeleteFailedEvent(com.sequenceiq.environment.environment.flow.deletion.event.EnvDeleteFailedEvent)

Example 5 with BaseNamedFlowEvent

use of com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent in project cloudbreak by hortonworks.

the class ResourceEncryptionInitializationHandlerTest method verifyEnvCreationEvent.

private void verifyEnvCreationEvent() {
    BaseNamedFlowEvent event = baseNamedFlowEventCaptor.getValue();
    assertThat(event).isInstanceOf(EnvCreationEvent.class);
    EnvCreationEvent envCreationEvent = (EnvCreationEvent) event;
    assertThat(envCreationEvent.getResourceName()).isEqualTo(ENVIRONMENT_NAME);
    assertThat(envCreationEvent.getResourceCrn()).isEqualTo(ENVIRONMENT_CRN);
    assertThat(envCreationEvent.getResourceId()).isEqualTo(ENVIRONMENT_ID);
    assertThat(envCreationEvent.selector()).isEqualTo(START_FREEIPA_CREATION_EVENT.selector());
    assertThat(headersArgumentCaptor.getValue()).isSameAs(headers);
}
Also used : BaseNamedFlowEvent(com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent) EnvCreationEvent(com.sequenceiq.environment.environment.flow.creation.event.EnvCreationEvent)

Aggregations

BaseNamedFlowEvent (com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent)12 EnvDeleteEvent (com.sequenceiq.environment.environment.flow.deletion.event.EnvDeleteEvent)7 EnvDeleteFailedEvent (com.sequenceiq.environment.environment.flow.deletion.event.EnvDeleteFailedEvent)3 EnvCreationEvent (com.sequenceiq.environment.environment.flow.creation.event.EnvCreationEvent)2