@Test public void checkInstancesHaveMultiplePackageVersionsNok() { when(instanceMetadataUpdater.collectPackagesWithMultipleVersions(anySet())).thenReturn(Collections.singletonList("package")); CheckResult result = underTest.checkInstancesHaveMultiplePackageVersions(Collections.emptySet()); assertEquals(EventStatus.FAILED, result.getStatus()); }
public CheckResult checkInstancesHaveMultiplePackageVersions(Set<InstanceMetaData> instanceMetaDataSet) { List<String> packagesWithMultipleVersions = instanceMetadataUpdater.collectPackagesWithMultipleVersions(instanceMetaDataSet); if (!packagesWithMultipleVersions.isEmpty()) { String message = messagesService.getMessage(CLUSTER_PACKAGES_ON_INSTANCES_ARE_DIFFERENT.getMessage(), Collections.singletonList(String.join(",", packagesWithMultipleVersions))); return CheckResult.failed(message); } return CheckResult.ok(); }
PackageVersionChecker { public CheckResult checkInstancesHaveMultiplePackageVersions(Set<InstanceMetaData> instanceMetaDataSet) { List<String> packagesWithMultipleVersions = instanceMetadataUpdater.collectPackagesWithMultipleVersions(instanceMetaDataSet); if (!packagesWithMultipleVersions.isEmpty()) { String message = messagesService.getMessage(CLUSTER_PACKAGES_ON_INSTANCES_ARE_DIFFERENT.getMessage(), Collections.singletonList(String.join(",", packagesWithMultipleVersions))); return CheckResult.failed(message); } return CheckResult.ok(); } }
PackageVersionChecker { public CheckResult checkInstancesHaveMultiplePackageVersions(Set<InstanceMetaData> instanceMetaDataSet) { List<String> packagesWithMultipleVersions = instanceMetadataUpdater.collectPackagesWithMultipleVersions(instanceMetaDataSet); if (!packagesWithMultipleVersions.isEmpty()) { String message = messagesService.getMessage(CLUSTER_PACKAGES_ON_INSTANCES_ARE_DIFFERENT.getMessage(), Collections.singletonList(String.join(",", packagesWithMultipleVersions))); return CheckResult.failed(message); } return CheckResult.ok(); }  }
PackageVersionChecker { public CheckResult checkInstancesHaveMultiplePackageVersions(Set<InstanceMetaData> instanceMetaDataSet) { List<String> packagesWithMultipleVersions = instanceMetadataUpdater.collectPackagesWithMultipleVersions(instanceMetaDataSet); if (!packagesWithMultipleVersions.isEmpty()) { String message = messagesService.getMessage(CLUSTER_PACKAGES_ON_INSTANCES_ARE_DIFFERENT.getMessage(), Collections.singletonList(String.join(",", packagesWithMultipleVersions))); return CheckResult.failed(message); } return CheckResult.ok(); }  CheckResult compareImageAndInstancesMandatoryPackageVersion(StatedImage newImage, Set<InstanceMetaData> instanceMetaDataSet); CheckResult checkInstancesHaveAllMandatoryPackageVersion(Set<InstanceMetaData> instanceMetaDataSet); CheckResult checkInstancesHaveMultiplePackageVersions(Set<InstanceMetaData> instanceMetaDataSet); }
PackageVersionChecker { public CheckResult checkInstancesHaveMultiplePackageVersions(Set<InstanceMetaData> instanceMetaDataSet) { List<String> packagesWithMultipleVersions = instanceMetadataUpdater.collectPackagesWithMultipleVersions(instanceMetaDataSet); if (!packagesWithMultipleVersions.isEmpty()) { String message = messagesService.getMessage(CLUSTER_PACKAGES_ON_INSTANCES_ARE_DIFFERENT.getMessage(), Collections.singletonList(String.join(",", packagesWithMultipleVersions))); return CheckResult.failed(message); } return CheckResult.ok(); }  CheckResult compareImageAndInstancesMandatoryPackageVersion(StatedImage newImage, Set<InstanceMetaData> instanceMetaDataSet); CheckResult checkInstancesHaveAllMandatoryPackageVersion(Set<InstanceMetaData> instanceMetaDataSet); CheckResult checkInstancesHaveMultiplePackageVersions(Set<InstanceMetaData> instanceMetaDataSet); static final String SALT_BOOTSTRAP; }