ScmProvider scmProviderMock = mock( ScmProvider.class );
when( scmProviderMock.tag( isA( ScmRepository.class ),
argThat( new IsScmFileSetEquals( fileSet ) ),
eq( "release-label" ),
argThat( new IsScmTagParametersEquals( 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 );
// execute
phase.execute( descriptor, new DefaultReleaseEnvironment(), reactorProjects );
// verify
verify( scmProviderMock ).tag( isA( ScmRepository.class ),
argThat( new IsScmFileSetEquals( fileSet ) ),
eq( "release-label" ),
argThat( new IsScmTagParametersEquals( new ScmTagParameters( "[my prefix] copy for tag release-label" ) ) ) );
verifyNoMoreInteractions( scmProviderMock );
}