@Test public void diff_does_not_include_run_always_changesets_if_they_do_not_match_any_execution_context() { Collection<Changeset> changesets = diffMaker.computeChangesetsToInsert( new ExecutionContexts(Arrays.asList("foo", "bar")), Arrays.asList( changeset("ID", "fbiville", "CREATE n", "baz", true, false), changeset("ID2", "fbiville", "CREATE m", "foo", true, false) ), singletonList(changeset("ID", "fbiville", "CREATE n")) ); assertThat(changesets) .extracting("id") .containsExactly("ID2"); }
public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); }
ChangelogDiffMaker { public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); } }
ChangelogDiffMaker { public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); }  }
ChangelogDiffMaker { public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); }  Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts,
                                                           Collection<Changeset> declaredChangesets,
                                                           Collection<Changeset> persistedChangesets); }
ChangelogDiffMaker { public Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts, Collection<Changeset> declaredChangesets, Collection<Changeset> persistedChangesets) { return declaredChangesets.stream() .filter(BY_ANY_EXECUTION_CONTEXT(executionContexts)) .filter(executionFilter(persistedChangesets)) .collect(toList()); }  Collection<Changeset> computeChangesetsToInsert(ExecutionContexts executionContexts,
                                                           Collection<Changeset> declaredChangesets,
                                                           Collection<Changeset> persistedChangesets);  }