@Test public void should_swallow_CodeBasePublication2_when_InvalidClassException() throws URISyntaxException { File file = new File( getClass() .getResource("/sample-publications/codebase-v2-bad-serialVersionUID.ser") .toURI()); boolean handled = publicationImporter.importPublicationFile(file); assertThat(handled, is(true)); verifyNoMoreInteractions(codeBaseImporter, invocationDataImporter, validator); }
@Override @SneakyThrows public boolean importPublicationFile(File file) { return lockTemplate.doWithLock( Lock.forPublication(file), () -> doImportPublicationFile(file), () -> { logger.info( "Processing of {} was already in progress in another transaction", file.getName()); return false; }); }
PublicationImporterImpl implements PublicationImporter { @Override @SneakyThrows public boolean importPublicationFile(File file) { return lockTemplate.doWithLock( Lock.forPublication(file), () -> doImportPublicationFile(file), () -> { logger.info( "Processing of {} was already in progress in another transaction", file.getName()); return false; }); } }
PublicationImporterImpl implements PublicationImporter { @Override @SneakyThrows public boolean importPublicationFile(File file) { return lockTemplate.doWithLock( Lock.forPublication(file), () -> doImportPublicationFile(file), () -> { logger.info( "Processing of {} was already in progress in another transaction", file.getName()); return false; }); }  }
PublicationImporterImpl implements PublicationImporter { @Override @SneakyThrows public boolean importPublicationFile(File file) { return lockTemplate.doWithLock( Lock.forPublication(file), () -> doImportPublicationFile(file), () -> { logger.info( "Processing of {} was already in progress in another transaction", file.getName()); return false; }); }  @Override @SneakyThrows boolean importPublicationFile(File file); }
PublicationImporterImpl implements PublicationImporter { @Override @SneakyThrows public boolean importPublicationFile(File file) { return lockTemplate.doWithLock( Lock.forPublication(file), () -> doImportPublicationFile(file), () -> { logger.info( "Processing of {} was already in progress in another transaction", file.getName()); return false; }); }  @Override @SneakyThrows boolean importPublicationFile(File file);  }