use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.database.StackDatabaseServerResponse in project cloudbreak by hortonworks.
the class DatabaseServiceTest method testGetDatabaseServerShouldReturnDatabaseServer.
@Test
public void testGetDatabaseServerShouldReturnDatabaseServer() {
when(stackOperations.getStackByCrn(CLUSTER_CRN)).thenReturn(createStack());
when(databaseServerV4Endpoint.getByCrn(DATABASE_CRN)).thenReturn(createDatabaseServerV4Response());
StackDatabaseServerResponse response = underTest.getDatabaseServer(CLUSTER_CRN);
assertThat(response.getClusterCrn()).isEqualTo(CLUSTER_CRN);
assertThat(response.getCrn()).isEqualTo(DATABASE_CRN);
assertThat(response.getResourceStatus()).isEqualTo(DatabaseServerResourceStatus.SERVICE_MANAGED);
assertThat(response.getStatus()).isEqualTo(DatabaseServerStatus.AVAILABLE);
}
Aggregations