ScmRepository repository = new ScmRepository( "svn", scmProviderRepository );
ScmProvider scmProviderMock = mock( ScmProvider.class );
when( scmProviderMock.branch( eq( repository ),
argThat(new IsScmFileSetEquals( fileSet ) ),
eq( "release-label" ),
argThat(new IsScmBranchParametersEquals( new ScmBranchParameters( "[my prefix] copy for branch release-label" ) ) ) ) ).
thenReturn( new BranchScmResult( "...", Collections.singletonList( new ScmFile( getPath (rootProject
.getFile() ), ScmFileStatus.TAGGED ) ) ) ) ;
ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.ROLE );
stub.setScmProvider( scmProviderMock );
stub.addScmRepositoryForUrl( scmUrl, repository );
// execute
phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );
// verify
verify( scmProviderMock ).branch( eq( repository ),
argThat(new IsScmFileSetEquals( fileSet ) ),
eq( "release-label" ),
argThat(new IsScmBranchParametersEquals( new ScmBranchParameters( "[my prefix] copy for branch release-label" ) ) ) );
verifyNoMoreInteractions( scmProviderMock );
}