@Test public void checkCommentsAreNotCopiedIfTmTextUnitCurrentVariantNotChanged() throws InterruptedException, ExecutionException, RepositoryNameAlreadyUsedException, AssetWithIdNotFoundException, RepositoryWithIdNotFoundException { TMTestData tmTestDataSource = new TMTestData(testIdWatcher); Repository sourceRepository = tmTestDataSource.repository; logger.debug("Create the target repository"); Repository targetRepository = repositoryService.createRepository(testIdWatcher.getEntityName("targetRepository")); TM tm = targetRepository.getTm(); Asset asset = assetService.createAssetWithContent(targetRepository.getId(), "fake_for_test", "fake for test"); Long assetId = asset.getId(); tmService.addTMTextUnit(tm.getId(), assetId, "zuora_error_message_verify_state_province_update", "Please enter a valid state, region or province", "Comment1"); tmService.addTMTextUnit(tm.getId(), assetId, "TEST2", "Content2", "Comment2"); tmService.addTMTextUnit(tm.getId(), assetId, "TEST3", "Content3", "Comment3"); CopyTmConfig copyTmConfig = new CopyTmConfig(); copyTmConfig.setSourceRepositoryId(sourceRepository.getId()); copyTmConfig.setTargetRepositoryId(targetRepository.getId()); leveragingService.copyTm(copyTmConfig).get(); leveragingService.copyTm(copyTmConfig).get(); List<TMTextUnitVariant> targetTranslations = tmTextUnitVariantRepository.findByTmTextUnitTmRepositoriesAndLocale_Bcp47TagNotOrderByContent(targetRepository, "en"); for (TMTextUnitVariant targetTranslation : targetTranslations) { Assert.assertEquals(1, targetTranslation.getTmTextUnitVariantComments().size()); } }
@Pollable(async = true, message = "Start copying translations between repository") public PollableFuture copyTm(CopyTmConfig copyTmConfig) throws AssetWithIdNotFoundException, RepositoryWithIdNotFoundException { if (CopyTmConfig.Mode.TUIDS.equals(copyTmConfig.getMode())) { copyTranslationBetweenTextUnits(copyTmConfig.getSourceToTargetTmTextUnitIds()); } else { copyTmBetweenRepositories(copyTmConfig); } return new PollableFutureTaskResult(); }
LeveragingService { @Pollable(async = true, message = "Start copying translations between repository") public PollableFuture copyTm(CopyTmConfig copyTmConfig) throws AssetWithIdNotFoundException, RepositoryWithIdNotFoundException { if (CopyTmConfig.Mode.TUIDS.equals(copyTmConfig.getMode())) { copyTranslationBetweenTextUnits(copyTmConfig.getSourceToTargetTmTextUnitIds()); } else { copyTmBetweenRepositories(copyTmConfig); } return new PollableFutureTaskResult(); } }
LeveragingService { @Pollable(async = true, message = "Start copying translations between repository") public PollableFuture copyTm(CopyTmConfig copyTmConfig) throws AssetWithIdNotFoundException, RepositoryWithIdNotFoundException { if (CopyTmConfig.Mode.TUIDS.equals(copyTmConfig.getMode())) { copyTranslationBetweenTextUnits(copyTmConfig.getSourceToTargetTmTextUnitIds()); } else { copyTmBetweenRepositories(copyTmConfig); } return new PollableFutureTaskResult(); }  }
LeveragingService { @Pollable(async = true, message = "Start copying translations between repository") public PollableFuture copyTm(CopyTmConfig copyTmConfig) throws AssetWithIdNotFoundException, RepositoryWithIdNotFoundException { if (CopyTmConfig.Mode.TUIDS.equals(copyTmConfig.getMode())) { copyTranslationBetweenTextUnits(copyTmConfig.getSourceToTargetTmTextUnitIds()); } else { copyTmBetweenRepositories(copyTmConfig); } return new PollableFutureTaskResult(); }  void performSourceLeveraging(List<TMTextUnit> tmTextUnits); @Pollable(async = true, message = "Start copying translations between repository") PollableFuture copyTm(CopyTmConfig copyTmConfig); }
LeveragingService { @Pollable(async = true, message = "Start copying translations between repository") public PollableFuture copyTm(CopyTmConfig copyTmConfig) throws AssetWithIdNotFoundException, RepositoryWithIdNotFoundException { if (CopyTmConfig.Mode.TUIDS.equals(copyTmConfig.getMode())) { copyTranslationBetweenTextUnits(copyTmConfig.getSourceToTargetTmTextUnitIds()); } else { copyTmBetweenRepositories(copyTmConfig); } return new PollableFutureTaskResult(); }  void performSourceLeveraging(List<TMTextUnit> tmTextUnits); @Pollable(async = true, message = "Start copying translations between repository") PollableFuture copyTm(CopyTmConfig copyTmConfig);  }