@Test public void testOriginalDateIsAddedToMessageBody() throws Exception { HighestValue transform = ImmutableHighestValue.of(null, HighestValue.Display.ORIGINAL_TIMESTAMP); List<List<Transmutation>> results = transform.apply(transformationResults); assertThat(results, not(empty())); assertThat(results.get(0), not(empty())); Transmutation result = results.get(0).get(0); assertThat("The result should contain the original time", result.metadata().messages(), hasItem(containsString(NOW.toString()))); }
@Override public List<List<Transmutation>> apply(List<List<Transmutation>> stageInput) { final List<Transmutation> stageResult = new ArrayList<>(); stageInput.stream().flatMap(Collection::stream) .max(Comparator.comparing(result -> new BigDecimal(result.value().toString()))) .ifPresent(transformResultStage -> stageResult.add(processMetadata(transformResultStage))); return Collections.singletonList(stageResult); }
HighestValue implements Transform { @Override public List<List<Transmutation>> apply(List<List<Transmutation>> stageInput) { final List<Transmutation> stageResult = new ArrayList<>(); stageInput.stream().flatMap(Collection::stream) .max(Comparator.comparing(result -> new BigDecimal(result.value().toString()))) .ifPresent(transformResultStage -> stageResult.add(processMetadata(transformResultStage))); return Collections.singletonList(stageResult); } }
HighestValue implements Transform { @Override public List<List<Transmutation>> apply(List<List<Transmutation>> stageInput) { final List<Transmutation> stageResult = new ArrayList<>(); stageInput.stream().flatMap(Collection::stream) .max(Comparator.comparing(result -> new BigDecimal(result.value().toString()))) .ifPresent(transformResultStage -> stageResult.add(processMetadata(transformResultStage))); return Collections.singletonList(stageResult); }  }
HighestValue implements Transform { @Override public List<List<Transmutation>> apply(List<List<Transmutation>> stageInput) { final List<Transmutation> stageResult = new ArrayList<>(); stageInput.stream().flatMap(Collection::stream) .max(Comparator.comparing(result -> new BigDecimal(result.value().toString()))) .ifPresent(transformResultStage -> stageResult.add(processMetadata(transformResultStage))); return Collections.singletonList(stageResult); }  @Nullable @JsonProperty("messageCodeSource") abstract Display tagMessageCode(); @Nullable abstract Display tagMessageBody(); @Override List<List<Transmutation>> apply(List<List<Transmutation>> stageInput); }
HighestValue implements Transform { @Override public List<List<Transmutation>> apply(List<List<Transmutation>> stageInput) { final List<Transmutation> stageResult = new ArrayList<>(); stageInput.stream().flatMap(Collection::stream) .max(Comparator.comparing(result -> new BigDecimal(result.value().toString()))) .ifPresent(transformResultStage -> stageResult.add(processMetadata(transformResultStage))); return Collections.singletonList(stageResult); }  @Nullable @JsonProperty("messageCodeSource") abstract Display tagMessageCode(); @Nullable abstract Display tagMessageBody(); @Override List<List<Transmutation>> apply(List<List<Transmutation>> stageInput);  }