use of com.sequenceiq.redbeams.domain.stack.DBStack in project cloudbreak by hortonworks.
the class DatabaseServerSslCertificateSyncServiceTest method getDBStack.
private DBStack getDBStack(SslConfig sslConfig) {
DBStack dbStack = new DBStack();
dbStack.setRegion(REGION);
dbStack.setSslConfig(sslConfig);
return dbStack;
}
use of com.sequenceiq.redbeams.domain.stack.DBStack in project cloudbreak by hortonworks.
the class DBStackServiceTest method setUp.
@Before
public void setUp() throws Exception {
initMocks(this);
dbStack = new DBStack();
}
use of com.sequenceiq.redbeams.domain.stack.DBStack in project cloudbreak by hortonworks.
the class DBStackStatusUpdaterTest method testUpdateStatus.
@Test
public void testUpdateStatus() {
dbStack.setDBStackStatus(new DBStackStatus(dbStack, DetailedDBStackStatus.CREATING_INFRASTRUCTURE, now));
DBStack savedStack = underTest.updateStatus(1L, DetailedDBStackStatus.PROVISIONED, "because").get();
verify(dbStackService).save(dbStack);
verify(redbeamsInMemoryStateStoreUpdaterService).update(1L, Status.AVAILABLE);
DBStackStatus dbStackStatus = savedStack.getDbStackStatus();
assertEquals(dbStack, dbStackStatus.getDBStack());
assertEquals(DetailedDBStackStatus.PROVISIONED.getStatus(), dbStackStatus.getStatus());
assertEquals("because", dbStackStatus.getStatusReason());
assertEquals(DetailedDBStackStatus.PROVISIONED, dbStackStatus.getDetailedDBStackStatus());
assertEquals(now, dbStackStatus.getCreated().longValue());
}
use of com.sequenceiq.redbeams.domain.stack.DBStack in project cloudbreak by hortonworks.
the class DBStackStatusUpdaterTest method setUp.
@Before
public void setUp() {
initMocks(this);
dbStack = new DBStack();
dbStack.setId(1L);
dbStackOptional = Optional.of(dbStack);
when(dbStackService.findById(1L)).thenReturn(dbStackOptional);
when(dbStackService.save(dbStack)).thenReturn(dbStack);
now = System.currentTimeMillis();
when(clock.getCurrentTimeMillis()).thenReturn(now);
}
use of com.sequenceiq.redbeams.domain.stack.DBStack in project cloudbreak by hortonworks.
the class RedbeamsCreationServiceTest method testShouldNotLaunchDatabaseServerWhenDatabaseServerConfigIsAvailable.
@Test
public void testShouldNotLaunchDatabaseServerWhenDatabaseServerConfigIsAvailable() {
when(dbStackService.findByNameAndEnvironmentCrn(DB_STACK_NAME, ENVIRONMENT_CRN)).thenReturn(Optional.empty());
when(databaseServerConfigService.findByEnvironmentCrnAndClusterCrn(ENVIRONMENT_CRN, CLUSTER_CRN)).thenReturn(Optional.of(databaseServerConfig));
when(databaseServerConfig.getDbStack()).thenReturn(Optional.of(dbStack));
DBStack launchedStack = underTest.launchDatabaseServer(dbStack, CLUSTER_CRN);
assertThat(launchedStack).isEqualTo(dbStack);
verifyNoInteractions(flowManager);
verifyNoMoreInteractions(databaseServerConfigService);
}
Aggregations