VersionStatus { public Optional<VespaVersion> systemVersion() { return versions().stream().filter(VespaVersion::isSystemVersion).findFirst(); } VersionStatus(List<VespaVersion> versions); Optional<VespaVersion> controllerVersion(); Optional<VespaVersion> systemVersion(); boolean isUpgrading(); List<VespaVersion> versions(); VespaVersion version(Version version); static VersionStatus empty(); static VersionStatus compute(Controller controller);  }
@Test public void testSystemVersionNeverShrinks() { ControllerTester tester = new ControllerTester(); Version version0 = Version.fromString("6.2"); tester.upgradeSystem(version0); assertEquals(version0, tester.controller().systemVersion()); Version ancientVersion = Version.fromString("5.1"); for (ZoneApi zone : tester.controller().zoneRegistry().zones().all().zones()) { for (Node node : tester.configServer().nodeRepository().list(zone.getId(), SystemApplication.configServer.id())) { Node downgradedNode = new Node.Builder(node).currentVersion(ancientVersion).build(); tester.configServer().nodeRepository().putNodes(zone.getId(), downgradedNode); break; } } tester.computeVersionStatus(); assertEquals(version0, tester.controller().systemVersion()); }