assertNotNull( getUserService( authorizationHeader ).createGuestUser() );
}
createAndIndexRepo( testRepoId, new File( getBasedir(), "src/test/repo-with-osgi" ).getAbsolutePath() );
BrowseService browseService = getBrowseService( authorizationHeader, false );
Map<String, String> inputMetadata = new HashMap<>( 3 );
inputMetadata.put( "buildNumber", "1" );
inputMetadata.put( "author", "alecharp" );
inputMetadata.put( "jenkins_version", "1.486" );
MetadataAddRequest metadataAddRequest = new MetadataAddRequest();
metadataAddRequest.setGroupId( "commons-cli" );
metadataAddRequest.setArtifactId( "commons-cli" );
metadataAddRequest.setVersion( "1.0" );
metadataAddRequest.setMetadatas( inputMetadata );
browseService.importMetadata( metadataAddRequest, testRepoId );
Map<String, String> metadatas =
toMap( browseService.getMetadatas( "commons-cli", "commons-cli", "1.0", testRepoId ) );
assertThat( metadatas ).isNotNull().isNotEmpty().contains( MapEntry.entry( "buildNumber", "1" ) ).contains(
MapEntry.entry( "author", "alecharp" ) ).contains( MapEntry.entry( "jenkins_version", "1.486" ) );
deleteTestRepo( testRepoId );