@Test public void postDeserializeTest() { Element element = new Element(); List<Step> steps = new ArrayList<>(); Step step = new Step(); List<Embedding> embeddings = new ArrayList<>(); Embedding embedding = new Embedding(); embedding.setMimeType(MimeType.PNG); embedding.setData("123"); embeddings.add(embedding); step.setEmbeddings(embeddings); List<ResultMatch> before = new ArrayList<>(); ResultMatch resultMatchBefore = new ResultMatch(); before.add(resultMatchBefore); step.setBefore(before); List<ResultMatch> after = new ArrayList<>(); ResultMatch resultMatchAfter = new ResultMatch(); after.add(resultMatchAfter); step.setAfter(after); steps.add(step); element.setSteps(steps); List<ResultMatch> elementAfter = new ArrayList<>(); ResultMatch resultMatchAfterElement = new ResultMatch(); elementAfter.add(resultMatchAfter); element.setAfter(elementAfter); assertThat(embedding.getData(), is("123")); elementJsonPostProcessor.postDeserialize(element, null, null); assertThat(embedding.getFilename(), is("attachment001.png")); }
@Override public void postDeserialize(final Element element, final JsonElement jsonElement, final Gson gson) { element.setFailOnPendingOrUndefined(propertyManager.isFailScenariosOnPendingOrUndefinedSteps()); processAttachments(element); }
ElementJsonPostProcessor implements PostProcessor<Element> { @Override public void postDeserialize(final Element element, final JsonElement jsonElement, final Gson gson) { element.setFailOnPendingOrUndefined(propertyManager.isFailScenariosOnPendingOrUndefinedSteps()); processAttachments(element); } }
ElementJsonPostProcessor implements PostProcessor<Element> { @Override public void postDeserialize(final Element element, final JsonElement jsonElement, final Gson gson) { element.setFailOnPendingOrUndefined(propertyManager.isFailScenariosOnPendingOrUndefinedSteps()); processAttachments(element); } @Inject  ElementJsonPostProcessor(
            final PropertyManager propertyManager,
            final FileIO fileIO,
            final CluecumberLogger logger
    ); }
ElementJsonPostProcessor implements PostProcessor<Element> { @Override public void postDeserialize(final Element element, final JsonElement jsonElement, final Gson gson) { element.setFailOnPendingOrUndefined(propertyManager.isFailScenariosOnPendingOrUndefinedSteps()); processAttachments(element); } @Inject  ElementJsonPostProcessor(
            final PropertyManager propertyManager,
            final FileIO fileIO,
            final CluecumberLogger logger
    ); @Override void postDeserialize(final Element element, final JsonElement jsonElement, final Gson gson); @Override void postSerialize(final JsonElement jsonElement, final Element element, final Gson gson); }
ElementJsonPostProcessor implements PostProcessor<Element> { @Override public void postDeserialize(final Element element, final JsonElement jsonElement, final Gson gson) { element.setFailOnPendingOrUndefined(propertyManager.isFailScenariosOnPendingOrUndefinedSteps()); processAttachments(element); } @Inject  ElementJsonPostProcessor(
            final PropertyManager propertyManager,
            final FileIO fileIO,
            final CluecumberLogger logger
    ); @Override void postDeserialize(final Element element, final JsonElement jsonElement, final Gson gson); @Override void postSerialize(final JsonElement jsonElement, final Element element, final Gson gson);  }