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