### Question:
AzureDatabaseServerParameterSetter implements DatabaseServerParameterSetter { @Override public void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType) { AzureDatabaseServerV4Parameters parameters = new AzureDatabaseServerV4Parameters(); if (SdxDatabaseAvailabilityType.HA.equals(availabilityType)) { parameters.setBackupRetentionDays(backupRetentionPeriodHa); parameters.setGeoRedundantBackup(geoRedundantBackupHa); } else if (SdxDatabaseAvailabilityType.NON_HA.equals(availabilityType)) { parameters.setBackupRetentionDays(backupRetentionPeriodNonHa); parameters.setGeoRedundantBackup(geoRedundantBackupNonHa); } else { throw new IllegalArgumentException(availabilityType + " database availability type is not supported on Azure."); } request.setAzure(parameters); }  @Override void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType); @Override CloudPlatform getCloudPlatform();  }### Answer:
@Test public void testHAServer() { underTest.setParameters(request, SdxDatabaseAvailabilityType.HA); verify(request).setAzure(captor.capture()); AzureDatabaseServerV4Parameters azureDatabaseServerV4Parameters = captor.getValue(); assertEquals(true, azureDatabaseServerV4Parameters.getGeoRedundantBackup()); assertEquals(30, azureDatabaseServerV4Parameters.getBackupRetentionDays()); }
@Test public void testNonHAServer() { underTest.setParameters(request, SdxDatabaseAvailabilityType.NON_HA); verify(request).setAzure(captor.capture()); AzureDatabaseServerV4Parameters azureDatabaseServerV4Parameters = captor.getValue(); assertEquals(false, azureDatabaseServerV4Parameters.getGeoRedundantBackup()); assertEquals(7, azureDatabaseServerV4Parameters.getBackupRetentionDays()); }
@Test public void shouldThrowExceptionWhenAvailabilityTypeIsNotSupported() { IllegalArgumentException result = Assertions.assertThrows(IllegalArgumentException.class, () -> underTest.setParameters(request, SdxDatabaseAvailabilityType.NONE)); assertEquals("NONE database availability type is not supported on Azure.", result.getMessage()); }