Search in sources :

Example 6 with StackDatabaseServerResponse

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);
}
Also used : StackDatabaseServerResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.database.StackDatabaseServerResponse) Test(org.junit.jupiter.api.Test)

Aggregations

StackDatabaseServerResponse (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.database.StackDatabaseServerResponse)6 DatabaseServerSslConfig (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.database.DatabaseServerSslConfig)4 SslConfigV4Response (com.sequenceiq.redbeams.api.endpoint.v4.databaseserver.responses.SslConfigV4Response)4 Test (org.junit.jupiter.api.Test)4 DatabaseServerV4Response (com.sequenceiq.redbeams.api.endpoint.v4.databaseserver.responses.DatabaseServerV4Response)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 Date (java.util.Date)2 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)1