MuleProjectValidator extends AbstractProjectValidator { protected void validateReferencedDomainsIfPresent(List<ArtifactCoordinates> dependencies) throws ValidationException { checkArgument(dependencies != null, "List of dependencies should not be null"); Set<ArtifactCoordinates> domains = dependencies.stream() .filter(d -> StringUtils.equals(MULE_DOMAIN.toString(), d.getClassifier())) .collect(Collectors.toSet()); validateDomain(domains); } MuleProjectValidator(ProjectInformation projectInformation, List<SharedLibraryDependency> sharedLibraries,
                              boolean strictCheck);  MuleProjectValidator(ProjectInformation projectInformation, List<SharedLibraryDependency> sharedLibraries,
                              ProjectRequirement requirement); static void isProjectStructureValid(String packagingType, Path projectBaseDir); void validateSharedLibraries(List<SharedLibraryDependency> sharedLibraries,
                                      List<ArtifactCoordinates> projectDependencies);  }
@Test public void validateReferencedDomainsIfPresentNull() throws ValidationException { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("List of dependencies should not be null"); validator.validateReferencedDomainsIfPresent(null); }
@Test public void validateReferencedDomainsIfPresent() throws ValidationException { MuleProjectValidator validatorSpy = spy(validator); doNothing().when(validatorSpy).validateDomain(any()); List<ArtifactCoordinates> dependencies = new ArrayList<>(); dependencies.add(buildDependency(GROUP_ID, ARTIFACT_ID)); validatorSpy.validateReferencedDomainsIfPresent(dependencies); verify(validatorSpy, times(1)).validateDomain(eq(emptySet())); }