@Test public void keepNumberOfVersionsTest() throws KettleException { IUnifiedRepository mockRepo = mock( IUnifiedRepository.class ); final HashMap<String, List<VersionSummary>> versionListMap = processVersionMap( mockRepo ); UnifiedRepositoryPurgeService purgeService = new UnifiedRepositoryPurgeService( mockRepo ); String fileId = "1"; int versionCount = 2; purgeService.keepNumberOfVersions( element1, versionCount ); verifyVersionCountDeletion( versionListMap, mockRepo, fileId, versionCount ); verify( mockRepo, never() ).deleteFileAtVersion( eq( "2" ), anyString() ); }
@Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); }
UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } }
UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } UnifiedRepositoryPurgeService( IUnifiedRepository unifiedRepository ); }
UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } 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(); }
UnifiedRepositoryPurgeService implements IPurgeService { @Override public void keepNumberOfVersions( RepositoryElementInterface element, int versionCount ) throws KettleException { String fileId = element.getObjectId().getId(); keepNumberOfVersions( fileId, versionCount ); } 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; }