@Test public void shouldThrowExceptionWhenAvailabilityTypeIsNotSupported() { IllegalArgumentException result = Assertions.assertThrows(IllegalArgumentException.class, () -> underTest.setParameters(request, SdxDatabaseAvailabilityType.NONE)); assertEquals("NONE database availability type is not supported on AWS.", result.getMessage()); }
@Override public void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType) { AwsDatabaseServerV4Parameters parameters = new AwsDatabaseServerV4Parameters(); if (SdxDatabaseAvailabilityType.HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodHa); parameters.setMultiAZ("true"); } else if (SdxDatabaseAvailabilityType.NON_HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodNonHa); parameters.setMultiAZ("false"); } else { throw new IllegalArgumentException(availabilityType + " database availability type is not supported on AWS."); } parameters.setEngineVersion(engineVersion); request.setAws(parameters); }
AwsDatabaseServerParameterSetter implements DatabaseServerParameterSetter { @Override public void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType) { AwsDatabaseServerV4Parameters parameters = new AwsDatabaseServerV4Parameters(); if (SdxDatabaseAvailabilityType.HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodHa); parameters.setMultiAZ("true"); } else if (SdxDatabaseAvailabilityType.NON_HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodNonHa); parameters.setMultiAZ("false"); } else { throw new IllegalArgumentException(availabilityType + " database availability type is not supported on AWS."); } parameters.setEngineVersion(engineVersion); request.setAws(parameters); } }
AwsDatabaseServerParameterSetter implements DatabaseServerParameterSetter { @Override public void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType) { AwsDatabaseServerV4Parameters parameters = new AwsDatabaseServerV4Parameters(); if (SdxDatabaseAvailabilityType.HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodHa); parameters.setMultiAZ("true"); } else if (SdxDatabaseAvailabilityType.NON_HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodNonHa); parameters.setMultiAZ("false"); } else { throw new IllegalArgumentException(availabilityType + " database availability type is not supported on AWS."); } parameters.setEngineVersion(engineVersion); request.setAws(parameters); }  }
AwsDatabaseServerParameterSetter implements DatabaseServerParameterSetter { @Override public void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType) { AwsDatabaseServerV4Parameters parameters = new AwsDatabaseServerV4Parameters(); if (SdxDatabaseAvailabilityType.HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodHa); parameters.setMultiAZ("true"); } else if (SdxDatabaseAvailabilityType.NON_HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodNonHa); parameters.setMultiAZ("false"); } else { throw new IllegalArgumentException(availabilityType + " database availability type is not supported on AWS."); } parameters.setEngineVersion(engineVersion); request.setAws(parameters); }  @Override void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType); @Override CloudPlatform getCloudPlatform(); }
AwsDatabaseServerParameterSetter implements DatabaseServerParameterSetter { @Override public void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType) { AwsDatabaseServerV4Parameters parameters = new AwsDatabaseServerV4Parameters(); if (SdxDatabaseAvailabilityType.HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodHa); parameters.setMultiAZ("true"); } else if (SdxDatabaseAvailabilityType.NON_HA.equals(availabilityType)) { parameters.setBackupRetentionPeriod(backupRetentionPeriodNonHa); parameters.setMultiAZ("false"); } else { throw new IllegalArgumentException(availabilityType + " database availability type is not supported on AWS."); } parameters.setEngineVersion(engineVersion); request.setAws(parameters); }  @Override void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType); @Override CloudPlatform getCloudPlatform();  }