@Test public void shouldGetStepThatWasAdded() { final Step expected = new Step(Step.ROOT_STEP.id(), "684fdqs638", versionService.version().getVersionId()); repository.add(expected); final Step actual = repository.get(expected.id(), Step.class); assertEquals(expected, actual); }
@Override public void add(Identifiable object) { if (object == null) { LOG.warn("cannot save null..."); return; } final File outputFile = getIdentifiableFile(object); try { FileUtils.touch(outputFile); } catch (IOException e) { LOG.error("Unable to prepare file for {}.", object, e); } try (GZIPOutputStream output = new GZIPOutputStream(new FileOutputStream(outputFile))) { mapper.writer().writeValue(output, object); } catch (IOException e) { LOG.error("Error saving {}", object, e); throw new TDPException(CommonErrorCodes.UNABLE_TO_SAVE_PREPARATION, e, ExceptionContext.build().put("id", object.id())); } LOG.debug("{} #{} saved", object.getClass().getSimpleName(), object.id()); }
FileSystemPreparationRepository extends ObjectPreparationRepository { @Override public void add(Identifiable object) { if (object == null) { LOG.warn("cannot save null..."); return; } final File outputFile = getIdentifiableFile(object); try { FileUtils.touch(outputFile); } catch (IOException e) { LOG.error("Unable to prepare file for {}.", object, e); } try (GZIPOutputStream output = new GZIPOutputStream(new FileOutputStream(outputFile))) { mapper.writer().writeValue(output, object); } catch (IOException e) { LOG.error("Error saving {}", object, e); throw new TDPException(CommonErrorCodes.UNABLE_TO_SAVE_PREPARATION, e, ExceptionContext.build().put("id", object.id())); } LOG.debug("{} #{} saved", object.getClass().getSimpleName(), object.id()); } }
FileSystemPreparationRepository extends ObjectPreparationRepository { @Override public void add(Identifiable object) { if (object == null) { LOG.warn("cannot save null..."); return; } final File outputFile = getIdentifiableFile(object); try { FileUtils.touch(outputFile); } catch (IOException e) { LOG.error("Unable to prepare file for {}.", object, e); } try (GZIPOutputStream output = new GZIPOutputStream(new FileOutputStream(outputFile))) { mapper.writer().writeValue(output, object); } catch (IOException e) { LOG.error("Error saving {}", object, e); throw new TDPException(CommonErrorCodes.UNABLE_TO_SAVE_PREPARATION, e, ExceptionContext.build().put("id", object.id())); } LOG.debug("{} #{} saved", object.getClass().getSimpleName(), object.id()); }  }
FileSystemPreparationRepository extends ObjectPreparationRepository { @Override public void add(Identifiable object) { if (object == null) { LOG.warn("cannot save null..."); return; } final File outputFile = getIdentifiableFile(object); try { FileUtils.touch(outputFile); } catch (IOException e) { LOG.error("Unable to prepare file for {}.", object, e); } try (GZIPOutputStream output = new GZIPOutputStream(new FileOutputStream(outputFile))) { mapper.writer().writeValue(output, object); } catch (IOException e) { LOG.error("Error saving {}", object, e); throw new TDPException(CommonErrorCodes.UNABLE_TO_SAVE_PREPARATION, e, ExceptionContext.build().put("id", object.id())); } LOG.debug("{} #{} saved", object.getClass().getSimpleName(), object.id()); }  @Override void add(Identifiable object); @Override Stream<T> source(Class<T> clazz); @Override void clear(); @Override void remove(Identifiable object); }
FileSystemPreparationRepository extends ObjectPreparationRepository { @Override public void add(Identifiable object) { if (object == null) { LOG.warn("cannot save null..."); return; } final File outputFile = getIdentifiableFile(object); try { FileUtils.touch(outputFile); } catch (IOException e) { LOG.error("Unable to prepare file for {}.", object, e); } try (GZIPOutputStream output = new GZIPOutputStream(new FileOutputStream(outputFile))) { mapper.writer().writeValue(output, object); } catch (IOException e) { LOG.error("Error saving {}", object, e); throw new TDPException(CommonErrorCodes.UNABLE_TO_SAVE_PREPARATION, e, ExceptionContext.build().put("id", object.id())); } LOG.debug("{} #{} saved", object.getClass().getSimpleName(), object.id()); }  @Override void add(Identifiable object); @Override Stream<T> source(Class<T> clazz); @Override void clear(); @Override void remove(Identifiable object);  }