### Question:
S3V4Authentication { static String buildCanonicalResourcePath(String path) { if (path == null || path.isEmpty()) return "/"; if (path.startsWith("/")) return path; else return "/".concat(path); } private  S3V4Authentication();  static final String AWS_V4_AUTH_TYPE; static final String AWS_CONTENT_SHA_HEADER; static final String AWS_EXPIRES_PARAM; static final String AWS_DECODED_CONTENT_LEN; static final String STREAMING_PAYLOAD; static final String UNSIGNED_PAYLOAD; }### Answer:
@Test public void testBuildCanonicalResourcePath() throws Throwable { URL url = new URL("http: assertEquals("/services/objectstorage/test-bucket/test-object", S3V4Authentication.buildCanonicalResourcePath(url.getPath())); }
@Test public void testBuildCanonicalResourcePathFromMessage() throws Throwable { MappingHttpRequest request = new MappingHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.PUT, "http: ); assertEquals( "Uri from http request with absolute url", "/services/objectstorage/test-bucket/test-object", S3V4Authentication.buildCanonicalResourcePath( request.getServicePath( ) )); }