### Question:
MavenRepositoryRequestInfo implements RepositoryRequestInfo { public String toNativePath( String requestedPath) throws LayoutException { if ( StringUtils.isBlank( requestedPath ) ) { throw new LayoutException( "Request Path is blank." ); } String referencedResource = requestedPath; String supportfile = ""; if ( isSupportFile( requestedPath ) ) { int idx = requestedPath.lastIndexOf( '.' ); referencedResource = requestedPath.substring( 0, idx ); supportfile = requestedPath.substring( idx ); } if ( isMetadata( referencedResource ) ) { if (requestedPath.startsWith( "/" )) { return requestedPath; } else { return "/"+requestedPath; } } String adjustedPath = repository.getContent( ).toPath( repository.getContent( ).toItem( requestedPath ) ); return adjustedPath + supportfile; } MavenRepositoryRequestInfo(ManagedRepository repository); @Override ItemSelector toItemSelector( String requestPath ); boolean isMetadata( String requestedPath ); boolean isArchetypeCatalog( String requestedPath ); boolean isSupportFile( String requestedPath ); boolean isMetadataSupportFile( String requestedPath ); @Override String getLayout(String requestPath); String toNativePath( String requestedPath); @Override RepositoryFeature<T> getFeature(Class<T> clazz); @Override boolean supportsFeature(Class<T> clazz);  }### Answer:
@Test public void testToNativePathArtifactDefaultToDefaultDualExtension() throws Exception { ManagedRepositoryContent repository = createManagedRepo( "default" ); assertEquals( "/org/project/example-presentation/3.2/example-presentation-3.2.xml.zip", repoRequest.toNativePath( "org/project/example-presentation/3.2/example-presentation-3.2.xml.zip") ); }
@Test public void testToNativePathMetadataDefaultToDefault() throws Exception { ManagedRepositoryContent repository = createManagedRepo( "default" ); assertEquals( "/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1", repoRequest.toNativePath( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1") ); }
@Test public void testNativePathBadRequestTooShort() throws Exception { ManagedRepositoryContent repository = createManagedRepo( "default" ); try { repoRequest.toNativePath( "org.apache.derby/license.txt"); fail( "Should have thrown an exception about a too short path." ); } catch ( LayoutException e ) { } }
@Test public void testNativePathBadRequestBlank() throws Exception { ManagedRepositoryContent repository = createManagedRepo( "default" ); try { repoRequest.toNativePath( ""); fail( "Should have thrown an exception about an blank request." ); } catch ( LayoutException e ) { } }
@Test public void testNativePathBadRequestNull() throws Exception { ManagedRepositoryContent repository = createManagedRepo( "default" ); try { repoRequest.toNativePath( null); fail( "Should have thrown an exception about an null request." ); } catch ( LayoutException e ) { } }
@Test public void testNativePathBadRequestUnknownType() throws Exception { ManagedRepositoryContent repository = createManagedRepo( "default" ); try { repoRequest.toNativePath( "org/apache/derby/derby/10.2.2.0/license.txt"); fail( "Should have thrown an exception about an invalid type." ); } catch ( LayoutException e ) { } }