### Question:
UnifiedRepositoryPurgeService implements IPurgeService { @Override public void deleteVersion( RepositoryElementInterface element, String versionId ) throws KettleException { String fileId = element.getObjectId().getId(); deleteVersion( fileId, versionId ); } UnifiedRepositoryPurgeService( IUnifiedRepository unifiedRepository ); @Override void deleteVersionsBeforeDate( RepositoryElementInterface element, Date beforeDate ); @Override void deleteVersionsBeforeDate( Serializable fileId, Date beforeDate ); @Override void deleteAllVersions( RepositoryElementInterface element ); @Override void deleteAllVersions( Serializable fileId ); @Override void deleteVersion( RepositoryElementInterface element, String versionId ); @Override void deleteVersion( Serializable fileId, Serializable versionId ); @Override void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ); @Override void keepNumberOfVersions( Serializable fileId, int versionCount ); void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ); static DefaultUnifiedRepositoryWebService getRepoWs(); static DefaultUnifiedRepositoryWebService repoWs; }### Answer:
@Test public void deleteVersionTest() throws KettleException { IUnifiedRepository mockRepo = mock( IUnifiedRepository.class ); final HashMap<String, List<VersionSummary>> versionListMap = processVersionMap( mockRepo ); UnifiedRepositoryPurgeService purgeService = new UnifiedRepositoryPurgeService( mockRepo ); String fileId = "1"; String versionId = "103"; purgeService.deleteVersion( element1, versionId ); verify( mockRepo, times( 1 ) ).deleteFileAtVersion( fileId, versionId ); verify( mockRepo, never() ).deleteFileAtVersion( eq( "2" ), anyString() ); }