}
public void testShouldNotInterpolateDependencyVersionWithInvalidReference()
throws Exception
{
Model model = new Model();
model.setVersion( "3.8.1" );
Dependency dep = new Dependency();
dep.setVersion( "${something}" );
model.addDependency( dep );
/*
// This is the desired behaviour, however there are too many crappy poms in the repo and an issue with the
// timing of executing the interpolation
try
{
new RegexBasedModelInterpolator().interpolate( model, context );
fail( "Should have failed to interpolate with invalid reference" );
}
catch ( ModelInterpolationException expected )
{
assertTrue( true );
}
*/
Model out = new RegexBasedModelInterpolator().interpolate( model, context );
assertEquals( "${something}", ( (Dependency) out.getDependencies().get( 0 ) ).getVersion() );
}