@Test public void testWithHalfCompleteSourcesAndWhitelist() throws IOException { Artifact artifact = setupForTest(Collections.emptyMap(), 50, Collections.emptyList(), Collections.singletonList(mkArtifactIdentifier())); final IPolicyEvaluation evaluate = validator.evaluate(Collections.singleton(artifact)); assertThat(evaluate).isNotNull(); assertThat(evaluate.getEvaluationResults().size()).isEqualTo(0); }
@Override public IPolicyEvaluation evaluate(Collection<Artifact> artifacts) { DefaultPolicyEvaluation policyEvaluation = new DefaultPolicyEvaluation(); artifacts.stream() .filter(artifact -> ! artifact.getFlag(Artifact.IS_PROPRIETARY_FLAG_KEY)) .filter(artifact -> artifact.getCoordinateForType(Coordinate.Types.MAVEN).isPresent()) .forEach(artifact -> validateSources(artifact) .forEach(policyEvaluation::addEvaluationResult)); return policyEvaluation; }
SourceValidator extends AbstractComplianceChecker { @Override public IPolicyEvaluation evaluate(Collection<Artifact> artifacts) { DefaultPolicyEvaluation policyEvaluation = new DefaultPolicyEvaluation(); artifacts.stream() .filter(artifact -> ! artifact.getFlag(Artifact.IS_PROPRIETARY_FLAG_KEY)) .filter(artifact -> artifact.getCoordinateForType(Coordinate.Types.MAVEN).isPresent()) .forEach(artifact -> validateSources(artifact) .forEach(policyEvaluation::addEvaluationResult)); return policyEvaluation; } }
SourceValidator extends AbstractComplianceChecker { @Override public IPolicyEvaluation evaluate(Collection<Artifact> artifacts) { DefaultPolicyEvaluation policyEvaluation = new DefaultPolicyEvaluation(); artifacts.stream() .filter(artifact -> ! artifact.getFlag(Artifact.IS_PROPRIETARY_FLAG_KEY)) .filter(artifact -> artifact.getCoordinateForType(Coordinate.Types.MAVEN).isPresent()) .forEach(artifact -> validateSources(artifact) .forEach(policyEvaluation::addEvaluationResult)); return policyEvaluation; } SourceValidator(); }
SourceValidator extends AbstractComplianceChecker { @Override public IPolicyEvaluation evaluate(Collection<Artifact> artifacts) { DefaultPolicyEvaluation policyEvaluation = new DefaultPolicyEvaluation(); artifacts.stream() .filter(artifact -> ! artifact.getFlag(Artifact.IS_PROPRIETARY_FLAG_KEY)) .filter(artifact -> artifact.getCoordinateForType(Coordinate.Types.MAVEN).isPresent()) .forEach(artifact -> validateSources(artifact) .forEach(policyEvaluation::addEvaluationResult)); return policyEvaluation; } SourceValidator(); @Override IPolicyEvaluation evaluate(Collection<Artifact> artifacts); @Override String getRulesetDescription(); @Override void configure(Map<String, String> configMap); }
SourceValidator extends AbstractComplianceChecker { @Override public IPolicyEvaluation evaluate(Collection<Artifact> artifacts) { DefaultPolicyEvaluation policyEvaluation = new DefaultPolicyEvaluation(); artifacts.stream() .filter(artifact -> ! artifact.getFlag(Artifact.IS_PROPRIETARY_FLAG_KEY)) .filter(artifact -> artifact.getCoordinateForType(Coordinate.Types.MAVEN).isPresent()) .forEach(artifact -> validateSources(artifact) .forEach(policyEvaluation::addEvaluationResult)); return policyEvaluation; } SourceValidator(); @Override IPolicyEvaluation evaluate(Collection<Artifact> artifacts); @Override String getRulesetDescription(); @Override void configure(Map<String, String> configMap);  }