### Question:
AwsDataSourceServiceImpl implements AwsDataSourceService { public List<AwsDBInstanceDTO> getAwsDBInstances(AWSCredentials awsCredentials, String amazonDBService, String region) { try { if (region!=null && region.contains(".")) { region=region.split("\\.")[0]; } if (amazonDBService.toLowerCase().equals(RDS)) { AmazonRDS rdsClient = AmazonRDSClientBuilder. standard(). withCredentials(new AWSStaticCredentialsProvider(awsCredentials)). withRegion(region). build(); return toRDSInstancesDTOs(getRdsInstances(rdsClient), amazonDBService); } else if (amazonDBService.toLowerCase().equals(Redshift)) { AmazonRedshift redshiftClient = AmazonRedshiftClientBuilder. standard(). withRegion(region). withCredentials(new AWSStaticCredentialsProvider(awsCredentials)). build(); return toRedshiftInstancesDTOs(getRedshiftInstances(redshiftClient), amazonDBService); } else { return new ArrayList<AwsDBInstanceDTO>(); } } catch (AmazonServiceException ex) { log.warn("Loading AWS data source metadata for " + amazonDBService +": " + ex.getMessage()); String errorCode = ex.getErrorCode(); if (ex.getStatusCode() == 403 && errorCode != null) { errorCode = errorCode.toLowerCase(); if (errorCode.equals(ACCESS_DENIED)) { return generateDBServiceInfoStatus(amazonDBService, "resource.dataSource.aws.access.denied"); } else if (errorCode.equals(INVALID_CLIENT_TOKEN_ID)) { throw new JSShowOnlyErrorMessage(messageSource.getMessage("" + "aws.exception.datasource.accessKey.invalid", null, LocaleContextHolder.getLocale())); } else if (errorCode.equals(SIGNATURE_DOES_NOT_MATCH)) { throw new JSShowOnlyErrorMessage(messageSource.getMessage("" + "aws.exception.datasource.secretKey.invalid", null, LocaleContextHolder.getLocale())); } } return generateDBServiceInfoStatus(amazonDBService, "[" + ex.getMessage() + "]"); } catch (AmazonClientException ex) { if (ex.getCause() instanceof UnknownHostException) { return generateDBServiceInfoStatus(region, "resource.dataSource.aws.unknown.host"); } return generateDBServiceInfoStatus(amazonDBService, "[" + ex.getMessage() + "]"); } }  List<AwsDBInstanceDTO> getAwsDBInstances(AWSCredentials awsCredentials, String amazonDBService,
            String region); void setJdbcConnectionMap(Map<String, Map<String, Object>> jdbcConnectionMap); void setAwsDataSourceActiveStatus(String awsDataSourceActiveStatus); void setMessageSource(MessageSource messageSource); static final String RDS; static final String Redshift; static final String jdbcUrl; static final String jdbcDriverClass; static final String ACCESS_DENIED; static final String INVALID_CLIENT_TOKEN_ID; static final String SIGNATURE_DOES_NOT_MATCH; }### Answer:
@Test public void getAwsDBInstances_unknownAwsService_returnEmptyList() { List<AwsDBInstanceDTO> unknownInstances = awsDataSourceService.getAwsDBInstances(awsCredentials, "UnknownAWSService", AWS_REGION); assertEquals(0, unknownInstances.size()); }