CloudStore { AWSSecurityTokenService getTokenServiceClient() { return AWSSecurityTokenServiceClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(credentials)) .withRegion(Regions.fromName(awsRegion)) .build(); } CloudStore(); void close(); void setHttpClient(HttpClient client); boolean isAwsEnabled(); AmazonS3 getS3Client(); AWSTemporaryCredentials assumeAWSRole(String account, String roleName, String principal,
                                                 Integer durationSeconds, String externalId); String getCloudAccount(String domainName);  }
@Test public void testGetTokenServiceClient() { CloudStore store = new CloudStore(); store.credentials = new BasicSessionCredentials("accessKey", "secretKey", "token"); store.awsEnabled = true; store.awsRegion = "us-west-2"; assertNotNull(store.getTokenServiceClient()); store.close(); }