MetadataVersionDelegate { public synchronized void addNewMetadataVersion( MetadataVersion version ) { version.setImportDate( new Date() ); try { metadataVersionService.addVersion( version ); } catch ( Exception e ) { throw new MetadataVersionServiceException( "Exception occurred while trying to add metadata version" + version, e ); } } MetadataVersionDelegate( DefaultMetadataSystemSettingService metadataSystemSettingService,
        SynchronizationManager synchronizationManager, RenderService renderService,
        MetadataVersionService metadataVersionService ); MetadataVersion getRemoteMetadataVersion( String versionName ); List<MetadataVersion> getMetaDataDifference( MetadataVersion metadataVersion ); String downloadMetadataVersionSnapshot(MetadataVersion version ); synchronized void addNewMetadataVersion( MetadataVersion version );  }
@Test public void testShouldAddNewMetadataVersion() { target.addNewMetadataVersion( metadataVersion ); verify( metadataVersionService, times( 1 ) ).addVersion( metadataVersion ); }