use of com.sequenceiq.cloudbreak.core.flow2.event.AwsVariantMigrationTriggerEvent in project cloudbreak by hortonworks.
the class AwsVariantMigrationActions method createResources.
@Bean(name = "CREATE_RESOURCES_STATE")
public Action<?, ?> createResources() {
return new AbstractAwsVariantMigrationAction<>(AwsVariantMigrationTriggerEvent.class) {
@Override
protected void doExecute(AwsVariantMigrationFlowContext context, AwsVariantMigrationTriggerEvent payload, Map<Object, Object> variables) throws Exception {
CreateResourcesRequest request = new CreateResourcesRequest(context.getCloudContext(), context.getCloudCredential(), context.getCloudStack(), payload.getHostGroupName());
sendEvent(context, request.selector(), request);
}
};
}
use of com.sequenceiq.cloudbreak.core.flow2.event.AwsVariantMigrationTriggerEvent in project cloudbreak by hortonworks.
the class ClusterRepairFlowEventChainFactoryTest method testAddAwsNativeMigrationIfNeedWhenUpgradeAndAwsNativeVariant.
@Test
public void testAddAwsNativeMigrationIfNeedWhenUpgradeAndAwsNativeVariant() {
Queue<Selectable> flowTriggers = new ConcurrentLinkedDeque<>();
String groupName = "groupName";
boolean upgrade = true;
String variant = "AWS_NATIVE";
underTest.addAwsNativeEventMigrationIfNeed(flowTriggers, STACK_ID, groupName, upgrade, variant);
Assertions.assertFalse(flowTriggers.isEmpty());
AwsVariantMigrationTriggerEvent actual = (AwsVariantMigrationTriggerEvent) flowTriggers.peek();
Assertions.assertEquals(groupName, actual.getHostGroupName());
}
Aggregations