Iterator failures = database.getIterator();
assertTrue( "check there is a failure", failures.hasNext() );
MetadataResults results = (MetadataResults) failures.next();
failures = results.getFailures().iterator();
assertTrue( "check there is a failure", failures.hasNext() );
ResultReason result = (ResultReason) failures.next();
assertMetadata( metadata, results );
// TODO: should be more robust
assertEquals( "check reason",
"Artifact version 1.0-alpha-3 is present in metadata but missing in the repository.", result
.getReason() );
assertTrue( "check there is a 2nd failure", failures.hasNext() );
result = (ResultReason) failures.next();
// TODO: should be more robust
assertEquals( "check reason",
"Artifact version 1.0-alpha-2 found in the repository but missing in the metadata.", result
.getReason() );
assertFalse( "check no more failures", failures.hasNext() );
}