### Question:
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();  }### Answer:
@Test public void testHAServer() { underTest.setParameters(request, SdxDatabaseAvailabilityType.HA); verify(request).setAws(captor.capture()); AwsDatabaseServerV4Parameters awsDatabaseServerV4Parameters = captor.getValue(); assertEquals("true", awsDatabaseServerV4Parameters.getMultiAZ()); assertEquals(30, awsDatabaseServerV4Parameters.getBackupRetentionPeriod()); }
@Test public void testNonHAServer() { underTest.setParameters(request, SdxDatabaseAvailabilityType.NON_HA); verify(request).setAws(captor.capture()); AwsDatabaseServerV4Parameters awsDatabaseServerV4Parameters = captor.getValue(); assertEquals("false", awsDatabaseServerV4Parameters.getMultiAZ()); assertEquals(0, awsDatabaseServerV4Parameters.getBackupRetentionPeriod()); }
@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()); }