@Test public void getMuleDomainsTest() throws URISyntaxException { List<BundleDependency> dependencies = new ArrayList<>(); BundleDependency bundleDependency1 = buildBundleDependency(0, 0, StringUtils.EMPTY); BundleDependency bundleDependency2 = buildBundleDependency(0, 1, StringUtils.EMPTY); BundleDependency bundleDependency3 = buildBundleDependency(0, 2, StringUtils.EMPTY); BundleDependency bundleDependencyDomain = buildBundleDependency(0, 3, MULE_DOMAIN.toString()); dependencies.add(bundleDependency1); dependencies.add(bundleDependency2); dependencies.add(bundleDependency3); dependencies.add(bundleDependencyDomain); Set<ArtifactCoordinates> expectedDependencies = new HashSet<>(); expectedDependencies.add(ArtifactUtils.toArtifactCoordinates(bundleDependencyDomain.getDescriptor())); Set<ArtifactCoordinates> actualDependencies = validator.getMuleDomains(dependencies); assertThat("Dependencies are not the expected", actualDependencies, equalTo(expectedDependencies)); }
protected Set<ArtifactCoordinates> getMuleDomains(List<BundleDependency> bundleDependencies) { return bundleDependencies.stream() .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().isPresent()) .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().get().equals(MULE_DOMAIN.toString())) .map(ArtifactUtils::toArtifact) .map(Artifact::getArtifactCoordinates) .collect(Collectors.toSet()); }
DomainBundleProjectValidator extends AbstractProjectValidator { protected Set<ArtifactCoordinates> getMuleDomains(List<BundleDependency> bundleDependencies) { return bundleDependencies.stream() .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().isPresent()) .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().get().equals(MULE_DOMAIN.toString())) .map(ArtifactUtils::toArtifact) .map(Artifact::getArtifactCoordinates) .collect(Collectors.toSet()); } }
DomainBundleProjectValidator extends AbstractProjectValidator { protected Set<ArtifactCoordinates> getMuleDomains(List<BundleDependency> bundleDependencies) { return bundleDependencies.stream() .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().isPresent()) .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().get().equals(MULE_DOMAIN.toString())) .map(ArtifactUtils::toArtifact) .map(Artifact::getArtifactCoordinates) .collect(Collectors.toSet()); } DomainBundleProjectValidator(ProjectInformation defaultProjectInformation,
                                      AetherMavenClient aetherMavenClient); }
DomainBundleProjectValidator extends AbstractProjectValidator { protected Set<ArtifactCoordinates> getMuleDomains(List<BundleDependency> bundleDependencies) { return bundleDependencies.stream() .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().isPresent()) .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().get().equals(MULE_DOMAIN.toString())) .map(ArtifactUtils::toArtifact) .map(Artifact::getArtifactCoordinates) .collect(Collectors.toSet()); } DomainBundleProjectValidator(ProjectInformation defaultProjectInformation,
                                      AetherMavenClient aetherMavenClient);  }
DomainBundleProjectValidator extends AbstractProjectValidator { protected Set<ArtifactCoordinates> getMuleDomains(List<BundleDependency> bundleDependencies) { return bundleDependencies.stream() .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().isPresent()) .filter(bundleDependency -> bundleDependency.getDescriptor().getClassifier().get().equals(MULE_DOMAIN.toString())) .map(ArtifactUtils::toArtifact) .map(Artifact::getArtifactCoordinates) .collect(Collectors.toSet()); } DomainBundleProjectValidator(ProjectInformation defaultProjectInformation,
                                      AetherMavenClient aetherMavenClient);   }