use fest assert to prevent issue with different collection impl

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1491204 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-06-09 12:44:28 +00:00
parent 1f226824a4
commit 1dba7c5b27
1 changed files with 12 additions and 4 deletions

View File

@ -240,15 +240,23 @@ public abstract class AbstractMetadataRepositoryTest
MailingList mailingList = new MailingList();
mailingList.setName( "Foo List" );
mailingList.setOtherArchives( Collections.<String>emptyList() );
metadata.setMailingLists( Collections.singletonList( mailingList ) );
metadata.setMailingLists( Arrays.asList( mailingList ) );
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( 1, metadata.getMailingLists().size() );
List<MailingList> mailingLists = metadata.getMailingLists();
Assertions.assertThat( mailingLists ).isNotNull().isNotEmpty().hasSize( 1 );
//assertEquals( 1, metadata.getMailingLists().size() );
mailingList = metadata.getMailingLists().get( 0 );
assertEquals( "Foo List", mailingList.getName() );
assertEquals( Collections.<String>emptyList(), mailingList.getOtherArchives() );
List<String> others = mailingList.getOtherArchives();
//assertEquals( Collections.<String>emptyList(), mailingList.getOtherArchives() );
Assertions.assertThat( others ).isNotNull().isEmpty();
}
@Test
@ -540,7 +548,7 @@ public abstract class AbstractMetadataRepositoryTest
testFacet = (TestMetadataFacet) metadata.getFacet( TEST_FACET_ID );
//assertFalse( testFacet.toProperties().containsKey( "deleteKey" ) );
Map<String,String> props = testFacet.toProperties();
Map<String, String> props = testFacet.toProperties();
Assertions.assertThat( props ).isNotNull().doesNotContainKey( "deleteKey" );
}