VersionDiscovery discovery = mock(VersionDiscovery.class);
NumericVersion overriddenVersion = new NumericVersion(4, 2, 2);
when(discovery.getLatestVersion()).thenReturn(overriddenVersion);
UpdateSystem updateSystem = ConfiguredUpdateSystem.loadProperties().butDiscoverAvailableVersionThrough(discovery).create();
Updater updater = getUpdaterThatHasRun(updateSystem);
Version latestVersion = updater.getLatestVersion();
assertThat(latestVersion, is(sameVersionAs(overriddenVersion)));
}