UpdateCheck implements Updater { @Override public Version getInstalledVersion() { assertCheckHasRun(); return currentVersion; } UpdateCheck(UpdateConnection updateConnection); @Override UpdateAvailability hasUpdate(); @Override Version getInstalledVersion(); @Override Version getLatestVersion(); @Override OngoingInstallation updateToLatestVersion(); @Override synchronized void runCheck();  }
@Test public void publishesCurrentlyInstalledVersion() throws Exception { assertThat(createExecutedUpdateCheck().getInstalledVersion(), is(currentVersion)); }
@Test(expected = IllegalStateException.class) public void expectsCheckToBeRunBeforeQueryingInstalledVersion() throws Exception { UpdateCheck updateCheck = createUpdateCheck(); updateCheck.getInstalledVersion(); }