use of com.sequenceiq.redbeams.flow.redbeams.common.RedbeamsEvent in project cloudbreak by hortonworks.
the class StopDatabaseServerFinishedActionTest method shouldIncrementMetricOnCreateRequest.
@Test
public void shouldIncrementMetricOnCreateRequest() {
RedbeamsStopContext context = new RedbeamsStopContext(flowParameters, cloudContext, cloudCredential, databaseStack);
RedbeamsEvent redbeamsEvent = (RedbeamsEvent) victim.createRequest(context);
assertEquals(RedbeamsStopEvent.REDBEAMS_STOP_FINISHED_EVENT.name(), redbeamsEvent.selector());
}
use of com.sequenceiq.redbeams.flow.redbeams.common.RedbeamsEvent in project cloudbreak by hortonworks.
the class AbstractRedbeamsTerminationActionTest method testCreateFlowContext.
@Test
public void testCreateFlowContext() {
when(dbStackService.findById(Long.valueOf(1L))).thenReturn(Optional.of(dbStack));
when(credentialService.getCredentialByEnvCrn("myenv")).thenReturn(credential);
when(credentialConverter.convert(credential)).thenReturn(cloudCredential);
when(databaseStackConverter.convert(dbStack)).thenReturn(databaseStack);
RedbeamsContext ctx = underTest.createFlowContext(flowParameters, stateContext, new RedbeamsEvent(1L));
assertEquals(dbStack.getId(), ctx.getCloudContext().getId());
assertEquals(dbStack.getName(), ctx.getCloudContext().getName());
assertEquals(Platform.platform(dbStack.getCloudPlatform()), ctx.getCloudContext().getPlatform());
assertEquals(Variant.variant(dbStack.getPlatformVariant()), ctx.getCloudContext().getVariant());
assertEquals(Location.location(Region.region(dbStack.getRegion()), AvailabilityZone.availabilityZone(dbStack.getAvailabilityZone())), ctx.getCloudContext().getLocation());
assertEquals(dbStack.getOwnerCrn().getAccountId(), ctx.getCloudContext().getAccountId());
assertEquals(cloudCredential, ctx.getCloudCredential());
assertEquals(databaseStack, ctx.getDatabaseStack());
}
Aggregations