DomainBundleProjectValidator extends AbstractProjectValidator { @Override protected void additionalValidation() throws ValidationException { Set<ArtifactCoordinates> domains = projectInformation.getProject().getDependencies().stream().filter(d -> MULE_DOMAIN.equals(d.getClassifier())) .collect(Collectors.toSet()); validateDomain(domains); List<ArtifactCoordinates> applications = projectInformation.getProject().getDependencies().stream().filter(d -> !MULE_DOMAIN.equals(d.getClassifier())) .collect(Collectors.toList()); validateApplications(domains.iterator().next(), applications); } DomainBundleProjectValidator(ProjectInformation defaultProjectInformation,
                                      AetherMavenClient aetherMavenClient);   }
@Test public void additionalValidationTest() throws ValidationException { ArtifactCoordinates applicationDomain = new ArtifactCoordinates(GROUP_ID, ARTIFACT_ID + MULE_DOMAIN, VERSION, TYPE, MULE_DOMAIN); Set<ArtifactCoordinates> domains = new HashSet<>(); domains.add(applicationDomain); List<ArtifactCoordinates> applicationDependencies = buildApplicationDependenciesWithDomain(applicationDomain); when(dependencyProjectMock.getDependencies()).thenReturn(applicationDependencies); DomainBundleProjectValidator validatorSpy = spy(new DomainBundleProjectValidator(defaultProjectInformation, aetherMavenClientMock)); doNothing().when(validatorSpy).validateDomain(domains); doNothing().when(validatorSpy).validateApplications(eq(applicationDomain), any()); validatorSpy.additionalValidation(); verify(validatorSpy, times(1)).validateDomain(domains); verify(validatorSpy, times(1)).validateApplications(eq(applicationDomain), any()); }