use of com.sequenceiq.cloudbreak.structuredevent.event.RdsDetails in project cloudbreak by hortonworks.
the class RdsConfigToRdsDetailsConverterTest method testWhenSourceWorkspaceIdIsNotNullThenItsValueShouldBePassedBesideAllLogicIndependentData.
@ParameterizedTest(name = "Current RDS type - Database vendor pair: [{0} - {1}]")
@MethodSource("databaseTypeAndVendorDataProvider")
public void testWhenSourceWorkspaceIdIsNotNullThenItsValueShouldBePassedBesideAllLogicIndependentData(DatabaseType databaseType, DatabaseVendor vendor) {
Workspace workspace = new Workspace();
workspace.setId(23L);
RDSConfig source = TestUtil.rdsConfig(databaseType, vendor);
source.setWorkspace(workspace);
RdsDetails result = underTest.convert(source);
assertThat(result).isNotNull();
}
use of com.sequenceiq.cloudbreak.structuredevent.event.RdsDetails in project cloudbreak by hortonworks.
the class RdsConfigToRdsDetailsConverter method convert.
public RdsDetails convert(RDSConfig source) {
RdsDetails rdsDetails = new RdsDetails();
rdsDetails.setSslMode(Optional.ofNullable(source.getSslMode()).map(Enum::name).orElse(null));
rdsDetails.setCreationDate(source.getCreationDate());
rdsDetails.setDatabaseEngine(source.getDatabaseEngine().name());
if (DatabaseVendor.EMBEDDED == source.getDatabaseEngine()) {
rdsDetails.setExternal(Boolean.FALSE);
} else {
rdsDetails.setExternal(Boolean.TRUE);
}
rdsDetails.setStackVersion(source.getStackVersion());
rdsDetails.setStatus(source.getStatus().name());
rdsDetails.setType(source.getType());
return rdsDetails;
}
use of com.sequenceiq.cloudbreak.structuredevent.event.RdsDetails in project cloudbreak by hortonworks.
the class RdsConfigToRdsDetailsConverterTest method testWhenSourceWorkspaceIdIsNullThenItsValueShouldBePassedBesideAllLogicIndependentData.
@ParameterizedTest(name = "Current RDS type - Database vendor pair: [{0} - {1}]")
@MethodSource("databaseTypeAndVendorDataProvider")
public void testWhenSourceWorkspaceIdIsNullThenItsValueShouldBePassedBesideAllLogicIndependentData(DatabaseType databaseType, DatabaseVendor vendor) {
RDSConfig source = TestUtil.rdsConfig(databaseType, vendor);
source.setWorkspace(null);
RdsDetails result = underTest.convert(source);
assertThat(result).isNotNull();
}
use of com.sequenceiq.cloudbreak.structuredevent.event.RdsDetails in project cloudbreak by hortonworks.
the class RdsConfigToRdsDetailsConverterTest method testAllLogicIndependentDataArePassedProperly.
@ParameterizedTest(name = "Current RDS type - Database vendor pair: [{0} - {1}]")
@MethodSource("databaseTypeAndVendorDataProvider")
public void testAllLogicIndependentDataArePassedProperly(DatabaseType databaseType, DatabaseVendor vendor) {
RDSConfig source = TestUtil.rdsConfig(databaseType, vendor);
RdsDetails result = underTest.convert(source);
assertThat(result).isNotNull();
assertThat(result.getCreationDate()).isEqualTo(source.getCreationDate());
assertThat(result.getDatabaseEngine()).isEqualTo(source.getDatabaseEngine().name());
assertThat(result.getStackVersion()).isEqualTo(source.getStackVersion());
assertThat(result.getStatus()).isEqualTo(source.getStatus().name());
assertThat(result.getType()).isEqualTo(source.getType());
}
use of com.sequenceiq.cloudbreak.structuredevent.event.RdsDetails in project cloudbreak by hortonworks.
the class RdsConfigToRdsDetailsConverterTest method testWhenDatabaseEngineIsEmbeddedThenIsExternalShouldBeFalseOtherwiseTrue.
@ParameterizedTest(name = "Current RDS type - Database vendor pair: [{0} - {1}]")
@MethodSource("databaseTypeAndVendorDataProvider")
public void testWhenDatabaseEngineIsEmbeddedThenIsExternalShouldBeFalseOtherwiseTrue(DatabaseType databaseType, DatabaseVendor vendor) {
RDSConfig source = TestUtil.rdsConfig(databaseType, vendor);
RdsDetails result = underTest.convert(source);
assertThat(result).isNotNull();
assertThat(result.getExternal()).isEqualTo(source.getDatabaseEngine() != DatabaseVendor.EMBEDDED);
}
Aggregations