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( "scm-commit", "/multimodule-with-deep-subprojects" );
// execute
phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );
// verify
assertEquals( "", descriptor.getScmRelativePathProjectDirectory() );
verify( scmProviderMock ).checkOut( eq( repository ),
argThat( new IsScmFileSetEquals( new ScmFileSet( checkoutDirectory ) ) ),
argThat( new IsScmTagEquals( new ScmTag( "release-label" ) ) ) );
verifyNoMoreInteractions( scmProviderMock );
}