public void testMergeComponentWithAssembly_ShouldAddOneFileSetToExistingListOfTwo()
{
final Assembly assembly = new Assembly();
FileSet fs = new FileSet();
fs.setDirectory( "/dir" );
assembly.addFileSet( fs );
fs = new FileSet();
fs.setDirectory( "/other-dir" );
assembly.addFileSet( fs );
fs = new FileSet();
fs.setDirectory( "/third-dir" );
final Component component = new Component();
component.addFileSet( fs );
new DefaultAssemblyReader().mergeComponentWithAssembly( component, assembly );
final List<FileSet> fileSets = assembly.getFileSets();
assertNotNull( fileSets );
assertEquals( 3, fileSets.size() );
final FileSet rfs1 = fileSets.get( 0 );
assertEquals( "/dir", rfs1.getDirectory() );
final FileSet rfs2 = fileSets.get( 1 );
assertEquals( "/other-dir", rfs2.getDirectory() );
final FileSet rfs3 = fileSets.get( 2 );
assertEquals( "/third-dir", rfs3.getDirectory() );
}