@Test public void validateOrderMulePluginTest() { dependencies1 = new ArrayList<>(); dependencies1.add(DEPENDENCY0); dependencies1.add(DEPENDENCY1); dependencies2 = new ArrayList<>(); dependencies2.add(DEPENDENCY1); dependencies2.add(DEPENDENCY0); assertThat("Validation should order-independent", validator.areMulePluginVersionCompatible(dependencies1) == validator.areMulePluginVersionCompatible(dependencies2), is(true)); }
protected boolean areMulePluginVersionCompatible(List<ArtifactCoordinates> dependencies) { Set<String> majors = dependencies.stream() .map(ArtifactCoordinates::getVersion) .map(VersionUtils::getMajor) .collect(Collectors.toSet()); return majors.size() <= 1; }
MulePluginsCompatibilityValidator { protected boolean areMulePluginVersionCompatible(List<ArtifactCoordinates> dependencies) { Set<String> majors = dependencies.stream() .map(ArtifactCoordinates::getVersion) .map(VersionUtils::getMajor) .collect(Collectors.toSet()); return majors.size() <= 1; } }
MulePluginsCompatibilityValidator { protected boolean areMulePluginVersionCompatible(List<ArtifactCoordinates> dependencies) { Set<String> majors = dependencies.stream() .map(ArtifactCoordinates::getVersion) .map(VersionUtils::getMajor) .collect(Collectors.toSet()); return majors.size() <= 1; }  }
MulePluginsCompatibilityValidator { protected boolean areMulePluginVersionCompatible(List<ArtifactCoordinates> dependencies) { Set<String> majors = dependencies.stream() .map(ArtifactCoordinates::getVersion) .map(VersionUtils::getMajor) .collect(Collectors.toSet()); return majors.size() <= 1; }  void validate(List<ArtifactCoordinates> mulePlugins); }
MulePluginsCompatibilityValidator { protected boolean areMulePluginVersionCompatible(List<ArtifactCoordinates> dependencies) { Set<String> majors = dependencies.stream() .map(ArtifactCoordinates::getVersion) .map(VersionUtils::getMajor) .collect(Collectors.toSet()); return majors.size() <= 1; }  void validate(List<ArtifactCoordinates> mulePlugins);  }