Search in sources :

Example 6 with AbstractActionTestSupport

use of com.sequenceiq.flow.core.AbstractActionTestSupport in project cloudbreak by hortonworks.

the class DatahubRefreshActionsTest method testStartTriggersCall.

@Test
public void testStartTriggersCall() throws Exception {
    DatahubRefreshStartEvent event = new DatahubRefreshStartEvent(SDX_ID, SDX_NAME, USER_CRN);
    AbstractAction action = (AbstractAction) underTest.startDatahubRefreshAction();
    initActionPrivateFields(action);
    AbstractActionTestSupport testSupport = new AbstractActionTestSupport(action);
    SdxContext context = SdxContext.from(new FlowParameters(FLOW_ID, USER_CRN, null), event);
    testSupport.doExecute(context, event, new HashMap());
    ArgumentCaptor<DatahubRefreshStartEvent> captor = ArgumentCaptor.forClass(DatahubRefreshStartEvent.class);
    verify(reactorEventFactory, times(1)).createEvent(any(), captor.capture());
    DatahubRefreshStartEvent captorValue = captor.getValue();
    Assertions.assertEquals(SDX_NAME, captorValue.getSdxName());
}
Also used : FlowParameters(com.sequenceiq.flow.core.FlowParameters) HashMap(java.util.HashMap) AbstractActionTestSupport(com.sequenceiq.flow.core.AbstractActionTestSupport) AbstractAction(com.sequenceiq.flow.core.AbstractAction) DatahubRefreshStartEvent(com.sequenceiq.datalake.flow.refresh.event.DatahubRefreshStartEvent) SdxContext(com.sequenceiq.datalake.flow.SdxContext) Test(org.junit.jupiter.api.Test)

Aggregations

AbstractActionTestSupport (com.sequenceiq.flow.core.AbstractActionTestSupport)6 FlowParameters (com.sequenceiq.flow.core.FlowParameters)6 Test (org.junit.jupiter.api.Test)6 SdxContext (com.sequenceiq.datalake.flow.SdxContext)4 AbstractAction (com.sequenceiq.flow.core.AbstractAction)4 DatalakeTriggerRestoreEvent (com.sequenceiq.datalake.flow.dr.restore.event.DatalakeTriggerRestoreEvent)3 DetailedStackStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.common.DetailedStackStatus)2 InstanceStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceStatus)2 CloudContext (com.sequenceiq.cloudbreak.cloud.context.CloudContext)2 StopStartUpscaleStartInstancesRequest (com.sequenceiq.cloudbreak.cloud.event.instance.StopStartUpscaleStartInstancesRequest)2 StopStartUpscaleStartInstancesResult (com.sequenceiq.cloudbreak.cloud.event.instance.StopStartUpscaleStartInstancesResult)2 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)2 CloudInstance (com.sequenceiq.cloudbreak.cloud.model.CloudInstance)2 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)2 CloudVmInstanceStatus (com.sequenceiq.cloudbreak.cloud.model.CloudVmInstanceStatus)2 MetricService (com.sequenceiq.cloudbreak.common.metrics.MetricService)2 ClusterManagerType (com.sequenceiq.cloudbreak.common.type.ClusterManagerType)2 CloudInstanceIdToInstanceMetaDataConverter (com.sequenceiq.cloudbreak.converter.CloudInstanceIdToInstanceMetaDataConverter)2 InstanceMetaDataToCloudInstanceConverter (com.sequenceiq.cloudbreak.converter.spi.InstanceMetaDataToCloudInstanceConverter)2 AbstractStopStartUpscaleActions (com.sequenceiq.cloudbreak.core.flow2.cluster.stopstartus.StopStartUpscaleActions.AbstractStopStartUpscaleActions)2