@Test public void should_ignore_unrecognized_content() throws IOException { File file = Files.newTemporaryFile(); file.deleteOnExit(); try (ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))) { oos.writeObject("Hello, World!"); } boolean handled = publicationImporter.importPublicationFile(file); assertThat(handled, is(false)); verify(validator).validate(anyString()); 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);  }