### Question:
DatabasePauseSupportService { public boolean isDatabasePauseSupported(SdxCluster sdxCluster) { if (sdxCluster.hasExternalDatabase() && Strings.isNotEmpty(sdxCluster.getDatabaseCrn())) { DetailedEnvironmentResponse environment = environmentClientService.getByCrn(sdxCluster.getEnvCrn()); return platformConfig.isExternalDatabasePauseSupportedFor(CloudPlatform.valueOf(environment.getCloudPlatform())); } return false; }  boolean isDatabasePauseSupported(SdxCluster sdxCluster);  }### Answer:
@Test public void sdxClusterWithoutDatabaseIsNotSupported() { when(sdxCluster.hasExternalDatabase()).thenReturn(false); assertFalse(victim.isDatabasePauseSupported(sdxCluster)); verifyZeroInteractions(environmentClientService); }
@Test public void sdxClusterWithoutDatabaseCrnIsNotSupported() { when(sdxCluster.hasExternalDatabase()).thenReturn(true); when(sdxCluster.getDatabaseCrn()).thenReturn(null); assertFalse(victim.isDatabasePauseSupported(sdxCluster)); verifyZeroInteractions(environmentClientService); }
@Test public void cloudPlatformIsNotSupported() { when(sdxCluster.hasExternalDatabase()).thenReturn(true); when(sdxCluster.getDatabaseCrn()).thenReturn(DATABASE_CRN); when(sdxCluster.getEnvCrn()).thenReturn(ENVIRONMENT_CRN); when(environmentClientService.getByCrn(ENVIRONMENT_CRN)).thenReturn(detailedEnvironmentResponse); when(detailedEnvironmentResponse.getCloudPlatform()).thenReturn(CloudPlatform.AZURE.name()); when(platformConfig.isExternalDatabasePauseSupportedFor(CloudPlatform.AZURE)).thenReturn(false); assertFalse(victim.isDatabasePauseSupported(sdxCluster)); }
@Test public void cloudPlatformIsSupported() { when(sdxCluster.hasExternalDatabase()).thenReturn(true); when(sdxCluster.getDatabaseCrn()).thenReturn(DATABASE_CRN); when(sdxCluster.getEnvCrn()).thenReturn(ENVIRONMENT_CRN); when(environmentClientService.getByCrn(ENVIRONMENT_CRN)).thenReturn(detailedEnvironmentResponse); when(detailedEnvironmentResponse.getCloudPlatform()).thenReturn(CloudPlatform.AWS.name()); when(platformConfig.isExternalDatabasePauseSupportedFor(CloudPlatform.AWS)).thenReturn(true); assertTrue(victim.isDatabasePauseSupported(sdxCluster)); }