@Test public void no_configured_contexts_matches_any_changeset_contexts() { assertThat(DEFAULT_CONTEXT.matches(Optional.empty())).isTrue(); assertThat(DEFAULT_CONTEXT.matches(Optional.of(Collections.<String>emptyList()))).isTrue(); assertThat(DEFAULT_CONTEXT.matches(Optional.of(singletonList("foo")))).isTrue(); }
public boolean matches(Optional<Collection<String>> declaredContexts) { if (!declaredContexts.isPresent()) { return true; } Collection<String> changesetContexts = declaredContexts.get(); if (changesetContexts.isEmpty()) { return true; } return changesetContexts.stream().anyMatch(anyContext); }
ExecutionContexts { public boolean matches(Optional<Collection<String>> declaredContexts) { if (!declaredContexts.isPresent()) { return true; } Collection<String> changesetContexts = declaredContexts.get(); if (changesetContexts.isEmpty()) { return true; } return changesetContexts.stream().anyMatch(anyContext); } }
ExecutionContexts { public boolean matches(Optional<Collection<String>> declaredContexts) { if (!declaredContexts.isPresent()) { return true; } Collection<String> changesetContexts = declaredContexts.get(); if (changesetContexts.isEmpty()) { return true; } return changesetContexts.stream().anyMatch(anyContext); } ExecutionContexts(Collection<String> executionContexts); private  ExecutionContexts(Optional<Collection<String>> contexts); }
ExecutionContexts { public boolean matches(Optional<Collection<String>> declaredContexts) { if (!declaredContexts.isPresent()) { return true; } Collection<String> changesetContexts = declaredContexts.get(); if (changesetContexts.isEmpty()) { return true; } return changesetContexts.stream().anyMatch(anyContext); } ExecutionContexts(Collection<String> executionContexts); private  ExecutionContexts(Optional<Collection<String>> contexts); boolean matches(Optional<Collection<String>> declaredContexts); }
ExecutionContexts { public boolean matches(Optional<Collection<String>> declaredContexts) { if (!declaredContexts.isPresent()) { return true; } Collection<String> changesetContexts = declaredContexts.get(); if (changesetContexts.isEmpty()) { return true; } return changesetContexts.stream().anyMatch(anyContext); } ExecutionContexts(Collection<String> executionContexts); private  ExecutionContexts(Optional<Collection<String>> contexts); boolean matches(Optional<Collection<String>> declaredContexts); static final ExecutionContexts DEFAULT_CONTEXT; }