Mock mock = new Mock( MavenExecutor.class );
Constraint[] constraints = new Constraint[]{new IsSame( checkoutDirectory ), new IsEqual( "goal1 goal2" ),
new IsEqual( Boolean.TRUE ), new IsEqual( "-Dmaven.test.skip=true -DperformRelease=true" ), new IsNull(),
new IsAnything()};
mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints );
RunPerformGoalsPhase phase = (RunPerformGoalsPhase) lookup( ReleasePhase.ROLE, "run-perform-goals" );
phase.setMavenExecutor( (MavenExecutor) mock.proxy() );
Mock scmProviderMock = new Mock( ScmProvider.class );
constraints = new Constraint[]{new IsAnything(), new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ),
new IsInstanceOf( ScmTag.class )};
scmProviderMock.expects( new InvokeOnceMatcher() ).method( "checkOut" ).with( constraints ).will(