ScmProvider scmProviderMock = mock( ScmProvider.class );
SvnScmProviderRepository scmProviderRepository = new SvnScmProviderRepository( sourceUrl );
ScmRepository repository = new ScmRepository( "svn", scmProviderRepository );
when( scmProviderMock.checkOut( eq( repository ),
argThat( new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ) ),
argThat( new IsScmTagEquals( new ScmTag( "release-label" ) ) ) ) ).thenReturn( new CheckOutScmResult( "", null ) );
ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
stub.setScmProvider( scmProviderMock );
stub.addScmRepositoryForUrl( scmUrl, repository );
List<MavenProject> reactorProjects = createReactorProjects( "rewrite-for-release/pom-with-parent-flat", "/root-project" );
// execute
phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );
// verify
assertEquals( "not found root-project but " + descriptor.getScmRelativePathProjectDirectory(), "root-project",
descriptor.getScmRelativePathProjectDirectory() );
verify( scmProviderMock ).checkOut( eq( repository ),
argThat( new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ) ),
argThat( new IsScmTagEquals( new ScmTag( "release-label" ) ) ) );
verifyNoMoreInteractions( scmProviderMock );
}