Search in sources :

Example 6 with DatabaseV4Response

use of com.sequenceiq.redbeams.api.endpoint.v4.database.responses.DatabaseV4Response in project cloudbreak by hortonworks.

the class DatabaseV4ControllerTest method testDeleteByName.

@Test
public void testDeleteByName() {
    when(service.deleteByName(DB_NAME, ENVIRONMENT_CRN)).thenReturn(db);
    when(databaseConfigToDatabaseV4ResponseConverter.convert(db)).thenReturn(response);
    DatabaseV4Response response = underTest.deleteByName(ENVIRONMENT_CRN, DB_NAME);
    assertEquals(db.getName(), response.getName());
}
Also used : DatabaseV4Response(com.sequenceiq.redbeams.api.endpoint.v4.database.responses.DatabaseV4Response) Test(org.junit.Test)

Example 7 with DatabaseV4Response

use of com.sequenceiq.redbeams.api.endpoint.v4.database.responses.DatabaseV4Response in project cloudbreak by hortonworks.

the class DatabaseV4ControllerTest method testDeleteByCrn.

@Test
public void testDeleteByCrn() {
    when(service.deleteByCrn(DB_CRN)).thenReturn(db);
    when(databaseConfigToDatabaseV4ResponseConverter.convert(db)).thenReturn(response);
    DatabaseV4Response response = underTest.deleteByCrn(DB_CRN);
    assertEquals(db.getName(), response.getName());
}
Also used : DatabaseV4Response(com.sequenceiq.redbeams.api.endpoint.v4.database.responses.DatabaseV4Response) Test(org.junit.Test)

Example 8 with DatabaseV4Response

use of com.sequenceiq.redbeams.api.endpoint.v4.database.responses.DatabaseV4Response in project cloudbreak by hortonworks.

the class DatabaseV4ControllerTest method testGetByName.

@Test
public void testGetByName() {
    when(service.getByName(DB_NAME, ENVIRONMENT_CRN)).thenReturn(db);
    when(databaseConfigToDatabaseV4ResponseConverter.convert(any())).thenReturn(new DatabaseV4Response());
    DatabaseV4Response response = underTest.getByName(ENVIRONMENT_CRN, DB_NAME);
    assertNotNull(response);
}
Also used : DatabaseV4Response(com.sequenceiq.redbeams.api.endpoint.v4.database.responses.DatabaseV4Response) Test(org.junit.Test)

Example 9 with DatabaseV4Response

use of com.sequenceiq.redbeams.api.endpoint.v4.database.responses.DatabaseV4Response in project cloudbreak by hortonworks.

the class DatabaseV4ControllerTest method testGetByCrn.

@Test
public void testGetByCrn() {
    when(service.getByCrn(DB_CRN)).thenReturn(db);
    when(databaseConfigToDatabaseV4ResponseConverter.convert(any())).thenReturn(new DatabaseV4Response());
    DatabaseV4Response response = underTest.getByCrn(DB_CRN);
    assertNotNull(response);
}
Also used : DatabaseV4Response(com.sequenceiq.redbeams.api.endpoint.v4.database.responses.DatabaseV4Response) Test(org.junit.Test)

Aggregations

DatabaseV4Response (com.sequenceiq.redbeams.api.endpoint.v4.database.responses.DatabaseV4Response)8 Test (org.junit.Test)5 DatabaseConfig (com.sequenceiq.redbeams.domain.DatabaseConfig)2 DatabaseV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.database.responses.DatabaseV4Response)1 SecretResponse (com.sequenceiq.cloudbreak.service.secret.model.SecretResponse)1 DatabaseV4Request (com.sequenceiq.redbeams.api.endpoint.v4.database.request.DatabaseV4Request)1 Before (org.junit.Before)1 Test (org.junit.jupiter.api.Test)1