def.setGroupId( dep.getGroupId() );
def.setArtifactId( dep.getArtifactId() );
def.setVersion( "1.0.1" );
def.setScope( "scope" );
Exclusion exc = new Exclusion();
exc.setArtifactId( "mydep" );
exc.setGroupId( "mygrp" );
def.addExclusion( exc );
DependencyManagement depMgmt = new DependencyManagement();
depMgmt.addDependency( def );
model.setDependencyManagement( depMgmt );
new DefaultModelDefaultsInjector().injectDefaults( model );
List deps = model.getDependencies();
assertEquals( 1, deps.size() );
Dependency result = (Dependency) deps.get( 0 );
assertEquals( def.getVersion(), result.getVersion() );
List resultExclusions = result.getExclusions();
assertNotNull( resultExclusions );
assertEquals( 1, resultExclusions.size() );
Exclusion resultExclusion = (Exclusion) resultExclusions.get( 0 );
assertEquals( "mydep", resultExclusion.getArtifactId() );
assertEquals( "mygrp", resultExclusion.getGroupId() );
}