@Test public void testRollbackShouldDeleteCurrentVariantsForGivenTextUnitsWhenTmTextUnitDidNotHaveAnyVariants() throws InterruptedException { TMTextUnit tmTextUnit1 = tmService.addTMTextUnit(tm.getId(), asset.getId(), "hello_world", "Hello World!", "Comments about hello world"); Long tmTextUnit1Id = tmTextUnit1.getId(); TMTextUnit tmTextUnit2 = tmService.addTMTextUnit(tm.getId(), asset.getId(), "hello_new_world", "Hello New World!", "Comments about hello new world"); Long tmTextUnit2Id = tmTextUnit2.getId(); assertOnlyEnglishVariantIsPresent(tmTextUnit1Id); assertOnlyEnglishVariantIsPresent(tmTextUnit2Id); DateTime dateTimeBeforeAddingVariant = new DateTime(); Thread.sleep(10); tmService.addCurrentTMTextUnitVariant(tmTextUnit1.getId(), frLocaleId, "Bonjour le monde!"); tmService.addCurrentTMTextUnitVariant(tmTextUnit1.getId(), jaLocaleId, "こんにちは、世界!"); tmService.addCurrentTMTextUnitVariant(tmTextUnit2.getId(), frLocaleId, "Bonjour le nouveau monde!"); tmService.addCurrentTMTextUnitVariant(tmTextUnit2.getId(), jaLocaleId, "新しい世界をこんにちは!"); assertCurrentVariantWasSet("The added variants should be set as current", Arrays.asList(frLocaleId, jaLocaleId), tmTextUnit1Id); assertCurrentVariantWasSet("The added variants should be set as current", Arrays.asList(frLocaleId, jaLocaleId), tmTextUnit2Id); CurrentVariantRollbackParameters rollbackParameters = new CurrentVariantRollbackParameters(); rollbackParameters.setTmTextUnitIds(Arrays.asList(tmTextUnit1Id)); currentVariantRollbackService.rollbackCurrentVariantsFromTMToDate(dateTimeBeforeAddingVariant, tm.getId(), rollbackParameters); assertNoCurrentVariantSet("After rollback, the current variants of the text unit 1 should have been deleted", Arrays.asList(frLocaleId, jaLocaleId), tmTextUnit1Id); assertCurrentVariantWasSet("After rollback, the current variants of the text unit 2 should still be there", Arrays.asList(frLocaleId, jaLocaleId), tmTextUnit2Id); assertVariantContentForCurrentVariantEquals("Bonjour le nouveau monde!", frLocaleId, tmTextUnit2Id); assertVariantContentForCurrentVariantEquals("新しい世界をこんにちは!", jaLocaleId, tmTextUnit2Id); }
public void rollbackCurrentVariantsFromTMToDate(DateTime rollbackDateTime, Long tmId) { rollbackCurrentVariantsFromTMToDate(rollbackDateTime, tmId, new CurrentVariantRollbackParameters()); }
CurrentVariantRollbackService { public void rollbackCurrentVariantsFromTMToDate(DateTime rollbackDateTime, Long tmId) { rollbackCurrentVariantsFromTMToDate(rollbackDateTime, tmId, new CurrentVariantRollbackParameters()); } }
CurrentVariantRollbackService { public void rollbackCurrentVariantsFromTMToDate(DateTime rollbackDateTime, Long tmId) { rollbackCurrentVariantsFromTMToDate(rollbackDateTime, tmId, new CurrentVariantRollbackParameters()); }  }
CurrentVariantRollbackService { public void rollbackCurrentVariantsFromTMToDate(DateTime rollbackDateTime, Long tmId) { rollbackCurrentVariantsFromTMToDate(rollbackDateTime, tmId, new CurrentVariantRollbackParameters()); }  void rollbackCurrentVariantsFromTMToDate(DateTime rollbackDateTime, Long tmId); @Transactional void rollbackCurrentVariantsFromTMToDate(DateTime rollbackDateTime, Long tmId, CurrentVariantRollbackParameters extraParameters); }
CurrentVariantRollbackService { public void rollbackCurrentVariantsFromTMToDate(DateTime rollbackDateTime, Long tmId) { rollbackCurrentVariantsFromTMToDate(rollbackDateTime, tmId, new CurrentVariantRollbackParameters()); }  void rollbackCurrentVariantsFromTMToDate(DateTime rollbackDateTime, Long tmId); @Transactional void rollbackCurrentVariantsFromTMToDate(DateTime rollbackDateTime, Long tmId, CurrentVariantRollbackParameters extraParameters);  }