@Test public void testRollbackShouldUndoChangesToCurrentVariantsForGivenLocalesAndTextUnitsWhenTmTextUnitHadVariants() 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(); 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, "新しい世界をこんにちは!"); DateTime dateTimeBeforeChangingCurrentVariant = new DateTime(); Thread.sleep(10); tmService.addCurrentTMTextUnitVariant(tmTextUnit1Id, frLocaleId, "Bonjour le monde! 2"); tmService.addCurrentTMTextUnitVariant(tmTextUnit1Id, frLocaleId, "Bonjour le monde! 3"); tmService.addCurrentTMTextUnitVariant(tmTextUnit1Id, jaLocaleId, "こんにちは、世界! 2"); tmService.addCurrentTMTextUnitVariant(tmTextUnit1Id, jaLocaleId, "こんにちは、世界! 3"); tmService.addCurrentTMTextUnitVariant(tmTextUnit2Id, frLocaleId, "Bonjour le nouveau monde! 2"); tmService.addCurrentTMTextUnitVariant(tmTextUnit2Id, frLocaleId, "Bonjour le nouveau monde! 3"); tmService.addCurrentTMTextUnitVariant(tmTextUnit2Id, jaLocaleId, "新しい世界をこんにちは! 2"); tmService.addCurrentTMTextUnitVariant(tmTextUnit2Id, jaLocaleId, "新しい世界をこんにちは! 3"); CurrentVariantRollbackParameters rollbackParameters = new CurrentVariantRollbackParameters(); rollbackParameters.setLocaleIds(Arrays.asList(jaLocaleId)); rollbackParameters.setTmTextUnitIds(Arrays.asList(tmTextUnit2Id)); currentVariantRollbackService.rollbackCurrentVariantsFromTMToDate(dateTimeBeforeChangingCurrentVariant, tm.getId(), rollbackParameters); assertVariantContentForCurrentVariantEquals("After rollback, the current variant 1 should not have changed for fr-FR", "Bonjour le monde! 3", frLocaleId, tmTextUnit1Id); assertVariantContentForCurrentVariantEquals("After rollback, the current variant 2 should not have changed for fr-FR", "Bonjour le nouveau monde! 3", frLocaleId, tmTextUnit2Id); assertVariantContentForCurrentVariantEquals("After rollback, the current variant 1 should not have changed for ja-JP", "こんにちは、世界! 3", jaLocaleId, tmTextUnit1Id); assertVariantContentForCurrentVariantEquals("After rollback, the current variant 2 should have been rolled back for ja-JP", "新しい世界をこんにちは!", 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);  }