use of com.walmartlabs.concord.dependencymanager.DependencyEntity in project concord by walmartlabs.
the class DependencyPolicyTest method testSingleDepDeny.
@Test
public void testSingleDepDeny() {
DependencyRule di = new DependencyRule(null, null, ".*", null, null, null);
PolicyRules<DependencyRule> rules = new PolicyRules<>(null, null, Collections.singletonList(di));
DependencyPolicy policy = new DependencyPolicy(rules);
DependencyEntity dependency = buildDependency("com.walmartlabs.concord.plugins.basic", "ansible-tasks", "0.57.1-SNAPSHOT");
// ---
assertDeny(policy, dependency);
}
use of com.walmartlabs.concord.dependencymanager.DependencyEntity in project concord by walmartlabs.
the class DependencyPolicy method check.
public CheckResult<DependencyRule, DependencyEntity> check(Collection<DependencyEntity> dependencies) {
if (rules == null || rules.isEmpty()) {
return CheckResult.success();
}
List<CheckResult.Item<DependencyRule, DependencyEntity>> warn = new ArrayList<>();
List<CheckResult.Item<DependencyRule, DependencyEntity>> deny = new ArrayList<>();
for (DependencyEntity e : dependencies) {
check(e, warn, deny);
}
return new CheckResult<>(warn, deny);
}
Aggregations