### Question:
OpushMigrationService { public MigrationResult update() { try { Version currentVersion = schemaDao.getCurrentVersion().getVersion(); if (currentVersion.equals(latestVersionUpdate)) { return MigrationResult.success("Nothing to do, your schema is already at the latest version"); } if (latestVersionUpdate.isLessThan(currentVersion)) { return MigrationResult.error(String.format( "Version %s conflicts with latest version %s", currentVersion.get(), latestVersionUpdate.get())); } migrate(currentVersion); schemaDao.updateVersion(latestVersionUpdate); if (currentVersion.isLessThan(minimalVersionUpdate)) { return MigrationResult.success(String.format( "Your schema has been updated from version %d to %d, please restart opush to get the service up", currentVersion.get(), latestVersionUpdate.get())); } return MigrationResult.success(String.format( "Your schema has been updated from version %d to %d", currentVersion.get(), latestVersionUpdate.get())); } catch (Exception e) { return MigrationResult.error(String.format( "An error occurred when updating the schema: %s", e.getMessage())); } } @Inject  OpushMigrationService(
			SchemaDao schemaDao,
			SchemaInstaller schemaInstaller,
			Set<MigrationService> migrationServices,
			@Named(MINIMAL_SCHEMA_VERSION_NAME) Version minimalVersionUpdate,
			@Named(LATEST_SCHEMA_VERSION_NAME) Version latestVersionUpdate); StatusSummary getStatus(); MigrationResult install(); MigrationResult update();  }### Answer:
@Test public void update() { Version minVersion = Version.of(1); Version toVersion = Version.of(2); Version currentVersion = Version.of(1); VersionUpdate versionUpdate = VersionUpdate.version(currentVersion).date(dateUTC("2013-04-07T12:09:37")); expect(schemaDao.getCurrentVersion()).andReturn(versionUpdate); migrationService.migrate(currentVersion, toVersion); expectLastCall(); schemaDao.updateVersion(toVersion); expectLastCall(); mocks.replay(); MigrationResult result = testee(minVersion, toVersion).update(); mocks.verify(); assertThat(result.getStatus()).isEqualTo(MigrationResult.Status.OK); assertThat(result.getMessage()).isEqualTo("Your schema has been updated from version 1 to 2"); }