### Question:
ServiceUtils { public static URL convertRequestToUrl(Request<?> request) { return convertRequestToUrl(request, false); }  static Date parseIso8601Date(String dateString); static String formatIso8601Date(Date date); static Date parseRfc822Date(String dateString); static String formatRfc822Date(Date date); static boolean isMultipartUploadETag(String eTag); static byte[] toByteArray(String s); static String removeQuotes(String s); static URL convertRequestToUrl(Request<?> request); static URL convertRequestToUrl(Request<?> request,
            boolean removeLeadingSlashInResourcePath); static String join(List<String> strings); static void downloadObjectToFile(S3Object s3Object,
            File destinationFile, boolean performIntegrityCheck,
            boolean appendData); static S3Object retryableDownloadS3ObjectToFile(File file,
            RetryableS3DownloadTask retryableS3DownloadTask, boolean appendData); static boolean skipMd5CheckPerResponse(ObjectMetadata metadata); static boolean skipMd5CheckPerResponse(ObjectMetadata metadata, S3ClientOptions clientOptions); static boolean skipMd5CheckPerRequest(AmazonWebServiceRequest request); static boolean skipMd5CheckPerRequest(AmazonWebServiceRequest request, S3ClientOptions clientOptions); static final boolean APPEND_MODE; static final boolean OVERWRITE_MODE; }### Answer:
@Test public void testConvertRequestToURL() throws URISyntaxException, MalformedURLException { final Request<String> req = new DefaultRequest<String>("s3"); req.setHttpMethod(HttpMethodName.GET); req.setEndpoint(new URI("https: req.setResourcePath("/TestFile.txt"); req.withParameter("AWSAccessKeyId", "TESTJDND73Z2EOXMTEST"); req.withParameter("Expires", "1430878121"); req.withParameter("Signature", "SxXP9iKzsnIeCjYBKFS8iW/9Bus="); final URL craftedURL = ServiceUtils.convertRequestToUrl(req, true); assertEquals( new URL( "https: craftedURL); final URL url = ServiceUtils.convertRequestToUrl(req); assertEquals( new URL( "https: url); }
@Test(expected = AmazonClientException.class) public void testConvertRequestUrlThrow() throws URISyntaxException { final Request<String> req = new DefaultRequest<String>("s3"); req.setHttpMethod(HttpMethodName.GET); req.setEndpoint(new URI("htps: req.setResourcePath("/TestFile.txt"); req.withParameter("AWSAccessKeyId", "TESTJDND73Z2EOXMTEST"); req.withParameter("Expires", "1430878121"); req.withParameter("Signature", "SxXP9iKzsnIeCjYBKFS8iW/9Bus="); final URL craftedURL = ServiceUtils.convertRequestToUrl(req, true); }