String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource );
File actualFile = new File( managedDefaultDir, proxiedFile );
assertTrue( "Release metadata for repo should exist: " + actualFile, actualFile.exists() );
VersionedReference metadata = createVersionedReference( requestedResource );
// Build expected metadata XML
StringWriter expectedMetadataXml = new StringWriter();
ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
m.setGroupId( metadata.getGroupId() );
m.setArtifactId( metadata.getArtifactId() );
m.setVersion( metadata.getVersion() );
m.setModelEncoding( null );
RepositoryMetadataWriter.write( m, expectedMetadataXml );
// Compare the file to the actual contents.
assertMetadataEquals( expectedMetadataXml.toString(), actualFile );