@Test public void getDependenciesWithFilter() { final MavenSession mavenSession = mockMavenSession(false); mockDependencies(mavenSession.getCurrentProject()); final ProjectPomModel pomModel = new ProjectPomModel(mavenSession); final Collection<AFReleaseId> dependencies = pomModel.getDependencies( (releaseId, scope) -> DEPENDENCY_SCOPE1.equals(scope)); assertThat(dependencies).isNotNull().hasSize(1); assertThat(dependencies).areExactly(1, new Condition<>( releaseId -> releaseId instanceof AFReleaseIdImpl && DEPENDENCY_GROUP_ID.equals(releaseId.getGroupId()) && DEPENDENCY_ARTIFACT_ID1.equals(releaseId.getArtifactId()) && DEPENDENCY_VERSION.equals(releaseId.getVersion()) && DEPENDENCY_PACKAGING.equals(((AFReleaseIdImpl) releaseId).getType()), "Is dependency 1")); }
@Override public Collection<AFReleaseId> getDependencies() { return dependenciesByScope.values() .stream() .flatMap(Collection::stream) .collect(Collectors.toList()); }
ProjectPomModel implements PomModel { @Override public Collection<AFReleaseId> getDependencies() { return dependenciesByScope.values() .stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } }
ProjectPomModel implements PomModel { @Override public Collection<AFReleaseId> getDependencies() { return dependenciesByScope.values() .stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } ProjectPomModel(final MavenSession mavenSession); }
ProjectPomModel implements PomModel { @Override public Collection<AFReleaseId> getDependencies() { return dependenciesByScope.values() .stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } ProjectPomModel(final MavenSession mavenSession); @Override AFReleaseId getReleaseId(); @Override AFReleaseId getParentReleaseId(); @Override Collection<AFReleaseId> getDependencies(); @Override Collection<AFReleaseId> getDependencies(final DependencyFilter filter); }
ProjectPomModel implements PomModel { @Override public Collection<AFReleaseId> getDependencies() { return dependenciesByScope.values() .stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } ProjectPomModel(final MavenSession mavenSession); @Override AFReleaseId getReleaseId(); @Override AFReleaseId getParentReleaseId(); @Override Collection<AFReleaseId> getDependencies(); @Override Collection<AFReleaseId> getDependencies(final DependencyFilter filter);  }