@Test public void testAsyncImportTextUnitsNameOnly() throws InterruptedException { TMTestData tmTestData = new TMTestData(testIdWatcher); TextUnitDTO textUnitDTO = new TextUnitDTO(); textUnitDTO.setRepositoryName(tmTestData.repository.getName()); textUnitDTO.setTargetLocale(tmTestData.frFR.getBcp47Tag()); textUnitDTO.setAssetPath(tmTestData.asset.getPath()); textUnitDTO.setName("TEST2"); textUnitDTO.setTarget("TEST2 translation for fr"); TextUnitDTO textUnitDTO2 = new TextUnitDTO(); textUnitDTO2.setRepositoryName(tmTestData.repository.getName()); textUnitDTO2.setTargetLocale(tmTestData.frFR.getBcp47Tag()); textUnitDTO2.setAssetPath(tmTestData.asset.getPath()); textUnitDTO2.setName("TEST3"); textUnitDTO2.setTarget("TEST3 translation for fr"); TextUnitDTO textUnitDTO3 = new TextUnitDTO(); textUnitDTO3.setRepositoryName(tmTestData.repository.getName()); textUnitDTO3.setTargetLocale(tmTestData.frFR.getBcp47Tag()); textUnitDTO3.setAssetPath(tmTestData.asset.getPath()); textUnitDTO3.setName("zuora_error_message_verify_state_province"); textUnitDTO3.setTarget("zuora_error_message_verify_state_province translation for fr"); List<TextUnitDTO> textUnitDTOsForImport = Arrays.asList(textUnitDTO, textUnitDTO2, textUnitDTO3); PollableFuture asyncImportTextUnits = textUnitBatchImporterService.asyncImportTextUnits(textUnitDTOsForImport, false, false); pollableTaskService.waitForPollableTask(asyncImportTextUnits.getPollableTask().getId()); TextUnitSearcherParameters textUnitSearcherParameters = new TextUnitSearcherParametersForTesting(); textUnitSearcherParameters.setRepositoryNames(Arrays.asList(tmTestData.repository.getName())); textUnitSearcherParameters.setAssetPath(tmTestData.asset.getPath()); textUnitSearcherParameters.setLocaleTags(Arrays.asList("fr-FR")); List<TextUnitDTO> textUnitDTOsFromSearch = textUnitSearcher.search(textUnitSearcherParameters); int i = 0; assertEquals("zuora_error_message_verify_state_province", textUnitDTOsFromSearch.get(i).getName()); assertEquals("zuora_error_message_verify_state_province translation for fr", textUnitDTOsFromSearch.get(i).getTarget()); i++; assertEquals("TEST2", textUnitDTOsFromSearch.get(i).getName()); assertEquals("TEST2 translation for fr", textUnitDTOsFromSearch.get(i).getTarget()); i++; assertEquals("TEST3", textUnitDTOsFromSearch.get(i).getName()); assertEquals("TEST3 translation for fr", textUnitDTOsFromSearch.get(i).getTarget()); i++; }
public PollableFuture<Void> asyncImportTextUnits(List<TextUnitDTO> textUnitDTOs, boolean integrityCheckSkipped, boolean integrityCheckKeepStatusIfFailedAndSameTarget) { ImportTextUnitJobInput importTextUnitJobInput = new ImportTextUnitJobInput(); importTextUnitJobInput.setTextUnitDTOs(textUnitDTOs); importTextUnitJobInput.setIntegrityCheckSkipped(integrityCheckSkipped); importTextUnitJobInput.setIntegrityCheckKeepStatusIfFailedAndSameTarget(integrityCheckKeepStatusIfFailedAndSameTarget); return quartzPollableTaskScheduler.scheduleJob(ImportTextUnitJob.class, importTextUnitJobInput); }
TextUnitBatchImporterService { public PollableFuture<Void> asyncImportTextUnits(List<TextUnitDTO> textUnitDTOs, boolean integrityCheckSkipped, boolean integrityCheckKeepStatusIfFailedAndSameTarget) { ImportTextUnitJobInput importTextUnitJobInput = new ImportTextUnitJobInput(); importTextUnitJobInput.setTextUnitDTOs(textUnitDTOs); importTextUnitJobInput.setIntegrityCheckSkipped(integrityCheckSkipped); importTextUnitJobInput.setIntegrityCheckKeepStatusIfFailedAndSameTarget(integrityCheckKeepStatusIfFailedAndSameTarget); return quartzPollableTaskScheduler.scheduleJob(ImportTextUnitJob.class, importTextUnitJobInput); } }
TextUnitBatchImporterService { public PollableFuture<Void> asyncImportTextUnits(List<TextUnitDTO> textUnitDTOs, boolean integrityCheckSkipped, boolean integrityCheckKeepStatusIfFailedAndSameTarget) { ImportTextUnitJobInput importTextUnitJobInput = new ImportTextUnitJobInput(); importTextUnitJobInput.setTextUnitDTOs(textUnitDTOs); importTextUnitJobInput.setIntegrityCheckSkipped(integrityCheckSkipped); importTextUnitJobInput.setIntegrityCheckKeepStatusIfFailedAndSameTarget(integrityCheckKeepStatusIfFailedAndSameTarget); return quartzPollableTaskScheduler.scheduleJob(ImportTextUnitJob.class, importTextUnitJobInput); }  }
TextUnitBatchImporterService { public PollableFuture<Void> asyncImportTextUnits(List<TextUnitDTO> textUnitDTOs, boolean integrityCheckSkipped, boolean integrityCheckKeepStatusIfFailedAndSameTarget) { ImportTextUnitJobInput importTextUnitJobInput = new ImportTextUnitJobInput(); importTextUnitJobInput.setTextUnitDTOs(textUnitDTOs); importTextUnitJobInput.setIntegrityCheckSkipped(integrityCheckSkipped); importTextUnitJobInput.setIntegrityCheckKeepStatusIfFailedAndSameTarget(integrityCheckKeepStatusIfFailedAndSameTarget); return quartzPollableTaskScheduler.scheduleJob(ImportTextUnitJob.class, importTextUnitJobInput); }  PollableFuture<Void> asyncImportTextUnits(List<TextUnitDTO> textUnitDTOs,
                                               boolean integrityCheckSkipped,
                                               boolean integrityCheckKeepStatusIfFailedAndSameTarget); PollableFuture importTextUnits(List<TextUnitDTO> textUnitDTOs,
                                          boolean integrityCheckSkipped,
                                          boolean integrityCheckKeepStatusIfFailedAndSameTarget); }
TextUnitBatchImporterService { public PollableFuture<Void> asyncImportTextUnits(List<TextUnitDTO> textUnitDTOs, boolean integrityCheckSkipped, boolean integrityCheckKeepStatusIfFailedAndSameTarget) { ImportTextUnitJobInput importTextUnitJobInput = new ImportTextUnitJobInput(); importTextUnitJobInput.setTextUnitDTOs(textUnitDTOs); importTextUnitJobInput.setIntegrityCheckSkipped(integrityCheckSkipped); importTextUnitJobInput.setIntegrityCheckKeepStatusIfFailedAndSameTarget(integrityCheckKeepStatusIfFailedAndSameTarget); return quartzPollableTaskScheduler.scheduleJob(ImportTextUnitJob.class, importTextUnitJobInput); }  PollableFuture<Void> asyncImportTextUnits(List<TextUnitDTO> textUnitDTOs,
                                               boolean integrityCheckSkipped,
                                               boolean integrityCheckKeepStatusIfFailedAndSameTarget); PollableFuture importTextUnits(List<TextUnitDTO> textUnitDTOs,
                                          boolean integrityCheckSkipped,
                                          boolean integrityCheckKeepStatusIfFailedAndSameTarget);  }