@Test
    public void testParseServiceName() {
        // Verify that parseServiceName keeps working the way it used to.
        assertEquals("iam", AwsHostNameUtils.parseServiceName(IAM_ENDPOINT));
        assertEquals("iam", AwsHostNameUtils.parseServiceName(IAM_REGION_ENDPOINT));
        assertEquals("ec2", AwsHostNameUtils.parseServiceName(EC2_REGION_ENDPOINT));
        assertEquals("s3",  AwsHostNameUtils.parseServiceName(S3_ENDPOINT));
        assertEquals("s3",  AwsHostNameUtils.parseServiceName(S3_BUCKET_ENDPOINT));
        assertEquals("s3",  AwsHostNameUtils.parseServiceName(S3_REGION_ENDPOINT));
        assertEquals("s3",  AwsHostNameUtils.parseServiceName(S3_BUCKET_REGION_ENDPOINT));
    }
Unit tests for the utility methods that parse information from AWS URLs.
aws-java-sdk-core/src/test/java/com/amazonaws/util/AwsHostNameUtilsTest.java