metadata.setId( TEST_PROJECT_VERSION );
metadata.setName( "project name" );
metadata.setDescription( "project description" );
MailingList mailingList = new MailingList();
mailingList.setName( "Foo List" );
mailingList.setOtherArchives( Collections.singletonList( "other archive" ) );
metadata.setMailingLists( Collections.singletonList( mailingList ) );
Scm scm = new Scm();
scm.setConnection( "connection" );
scm.setDeveloperConnection( "dev conn" );
scm.setUrl( "url" );
metadata.setScm( scm );
CiManagement ci = new CiManagement();
ci.setSystem( "system" );
ci.setUrl( "ci url" );
metadata.setCiManagement( ci );
IssueManagement tracker = new IssueManagement();
tracker.setSystem( "system" );
tracker.setUrl( "issue tracker url" );
metadata.setIssueManagement( tracker );
Organization org = new Organization();
org.setName( "org name" );
org.setUrl( "url" );
metadata.setOrganization( org );
License l = new License();
l.setName( "license name" );
l.setUrl( "license url" );
metadata.addLicense( l );
Dependency d = new Dependency();
d.setArtifactId( "artifactId" );
d.setClassifier( "classifier" );
d.setGroupId( "groupId" );
d.setScope( "scope" );
d.setSystemPath( "system path" );
d.setType( "type" );
d.setVersion( "version" );
d.setOptional( true );
metadata.addDependency( d );
repository.updateProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, metadata );
metadata = repository.getProjectVersion( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
assertEquals( TEST_PROJECT_VERSION, metadata.getId() );
assertEquals( TEST_PROJECT_VERSION, metadata.getVersion() );
assertEquals( "project name", metadata.getName() );
assertEquals( "project description", metadata.getDescription() );
assertEquals( 1, metadata.getMailingLists().size() );
mailingList = metadata.getMailingLists().get( 0 );
assertEquals( "Foo List", mailingList.getName() );
assertEquals( Collections.singletonList( "other archive" ), mailingList.getOtherArchives() );
assertEquals( "connection", metadata.getScm().getConnection() );
assertEquals( "dev conn", metadata.getScm().getDeveloperConnection() );
assertEquals( "url", metadata.getScm().getUrl() );