Plugin pPlugin = new Plugin();
pPlugin.setGroupId( "test" );
pPlugin.setArtifactId( "test-artifact" );
pPlugin.setVersion( "1.0-SNAPSHOT" );
PluginExecution pExec = new PluginExecution();
pExec.setId("profile-injected");
Xpp3Dom pConfigChild = new Xpp3Dom( "test" );
pConfigChild.setValue( "replacedValue" );
Xpp3Dom pConfig = new Xpp3Dom( "configuration" );
pConfig.addChild( pConfigChild );
pExec.setConfiguration( pConfig );
pPlugin.addExecution( pExec );
BuildBase pBuild = new BuildBase();
pBuild.addPlugin( pPlugin );
Profile profile = new Profile();
profile.setId( "testId" );
profile.setBuild( pBuild );
new DefaultProfileInjector().inject( profile, model );
Build rBuild = model.getBuild();
Plugin rPlugin = (Plugin) rBuild.getPlugins().get( 0 );
PluginExecution rExec = (PluginExecution) rPlugin.getExecutionsAsMap().get( "profile-injected" );
assertNotNull( rExec );
Xpp3Dom rExecConfig = (Xpp3Dom) rExec.getConfiguration();
Xpp3Dom rChild = rExecConfig.getChild( "test" );
assertEquals( "replacedValue", rChild.getValue() );