S3Configuration { static Region resolveRegion(String str) { Region region = null; if ((null != str) && (str.length() > 0)) { Regions regions; try { regions = Regions.valueOf(str); } catch (IllegalArgumentException ex) { regions = Regions.fromName(str); } region = Region.getRegion(regions); } return region; }  String getAccessKey(); void setAccessKey(String accessKey); String getSecretKey(); void setSecretKey(String secretKey); String getSessionToken(); void setSessionToken(String sessionToken); Region getRegion(); S3SSEConfiguration getSseConfiguration(); void setSseConfiguration(S3SSEConfiguration sseConfiguration); CannedAccessControlList getCannedAcl(); void setCannedAclFromValue(String cannedAclValue); void setRegion(String regionName); String getBucket(); void setBucket(String bucket); String getPath(); void setPath(String path); String getServiceEndpoint(); void setServiceEndpoint(String serviceEndpoint); String getSigningRegion(); void setSigningRegion(String signingRegion); boolean isCompressionEnabled(); void setCompressionEnabled(boolean compressionEnabled); String toString();  }
@Test public void testResolveRegionNegative() { thrown.expect(IllegalArgumentException.class); S3Configuration.resolveRegion("asdf"); }
@Test public void testResolveRegionNullOrBlank() { assertNull("null input should return null Region", S3Configuration.resolveRegion(null)); assertNull("blank input should return null Region", S3Configuration.resolveRegion("")); }