### Question:
AzureDatabaseResourceService { public ExternalDatabaseStatus getDatabaseServerStatus(AuthenticatedContext ac, DatabaseStack stack) { CloudContext cloudContext = ac.getCloudContext(); AzureClient client = ac.getParameter(AzureClient.class); String resourceGroupName = azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, stack); try { ResourceGroup resourceGroup = client.getResourceGroup(resourceGroupName); if (resourceGroup == null) { return ExternalDatabaseStatus.DELETED; } return ExternalDatabaseStatus.STARTED; } catch (Exception e) { LOGGER.error(e.getMessage()); throw new CloudConnectorException(e); } }  List<CloudResourceStatus> buildDatabaseResourcesForLaunch(AuthenticatedContext ac, DatabaseStack stack, PersistenceNotifier persistenceNotifier); List<CloudResourceStatus> terminateDatabaseServer(AuthenticatedContext ac, DatabaseStack stack,
            List<CloudResource> resources, boolean force, PersistenceNotifier persistenceNotifier); ExternalDatabaseStatus getDatabaseServerStatus(AuthenticatedContext ac, DatabaseStack stack);  }### Answer:
@Test void shouldReturnDeletedStatusInCaseOfMissingResourceGroup() { when(client.getResourceGroup(RESOURCE_GROUP_NAME)).thenReturn(null); when(azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, databaseStack)).thenReturn(RESOURCE_GROUP_NAME); ExternalDatabaseStatus actual = victim.getDatabaseServerStatus(ac, databaseStack); assertEquals(ExternalDatabaseStatus.DELETED, actual); }
@Test void shouldReturnStartedStatusInCaseOfExistingResourceGroup() { when(client.getResourceGroup(RESOURCE_GROUP_NAME)).thenReturn(resourceGroup); when(azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, databaseStack)).thenReturn(RESOURCE_GROUP_NAME); ExternalDatabaseStatus actual = victim.getDatabaseServerStatus(ac, databaseStack); assertEquals(ExternalDatabaseStatus.STARTED, actual); }