@Test @Category({IntegrationTest.class}) public void testExportDrop() throws InterruptedException, ResourceNotCreatedException { List<String> bcp47Tags = Arrays.asList("fr-FR", "ja-JP"); Set<RepositoryLocale> repositoryLocales = getRepositoryLocales(bcp47Tags); Repository repository = repositoryClient.createRepository(testIdWatcher.getEntityName("repository"), null, null, repositoryLocales, null, null); ExportDropConfig exportDropConfig = new ExportDropConfig(); exportDropConfig.setRepositoryId(repository.getId()); exportDropConfig.setBcp47Tags(bcp47Tags); exportDropConfig = dropClient.exportDrop(exportDropConfig); pollableTaskClient.waitForPollableTask(exportDropConfig.getPollableTask().getId(), 20000L); for (RepositoryLocale repositoryLocale : repository.getRepositoryLocales()) { if (repositoryLocale.getParentLocale() != null) { assertTrue(bcp47Tags.contains(repositoryLocale.getLocale().getBcp47Tag())); } else { assertEquals("en", repositoryLocale.getLocale().getBcp47Tag()); } } }
@RequestMapping(method = RequestMethod.POST, value = "/api/drops/export") public ExportDropConfig exportDrop(@RequestBody ExportDropConfig exportDropConfig) throws DropExporterException { PollableFuture<Drop> exportDropFuture = dropService.startDropExportProcess(exportDropConfig, PollableTask.INJECT_CURRENT_TASK); exportDropConfig.setPollableTask(exportDropFuture.getPollableTask()); try { exportDropConfig.setDropId(exportDropFuture.get().getId()); } catch (ExecutionException | InterruptedException e) { logger.debug("Cannot get dropId from the pollable due to exception", e); } return exportDropConfig; }
DropWS { @RequestMapping(method = RequestMethod.POST, value = "/api/drops/export") public ExportDropConfig exportDrop(@RequestBody ExportDropConfig exportDropConfig) throws DropExporterException { PollableFuture<Drop> exportDropFuture = dropService.startDropExportProcess(exportDropConfig, PollableTask.INJECT_CURRENT_TASK); exportDropConfig.setPollableTask(exportDropFuture.getPollableTask()); try { exportDropConfig.setDropId(exportDropFuture.get().getId()); } catch (ExecutionException | InterruptedException e) { logger.debug("Cannot get dropId from the pollable due to exception", e); } return exportDropConfig; } }
DropWS { @RequestMapping(method = RequestMethod.POST, value = "/api/drops/export") public ExportDropConfig exportDrop(@RequestBody ExportDropConfig exportDropConfig) throws DropExporterException { PollableFuture<Drop> exportDropFuture = dropService.startDropExportProcess(exportDropConfig, PollableTask.INJECT_CURRENT_TASK); exportDropConfig.setPollableTask(exportDropFuture.getPollableTask()); try { exportDropConfig.setDropId(exportDropFuture.get().getId()); } catch (ExecutionException | InterruptedException e) { logger.debug("Cannot get dropId from the pollable due to exception", e); } return exportDropConfig; }  }
DropWS { @RequestMapping(method = RequestMethod.POST, value = "/api/drops/export") public ExportDropConfig exportDrop(@RequestBody ExportDropConfig exportDropConfig) throws DropExporterException { PollableFuture<Drop> exportDropFuture = dropService.startDropExportProcess(exportDropConfig, PollableTask.INJECT_CURRENT_TASK); exportDropConfig.setPollableTask(exportDropFuture.getPollableTask()); try { exportDropConfig.setDropId(exportDropFuture.get().getId()); } catch (ExecutionException | InterruptedException e) { logger.debug("Cannot get dropId from the pollable due to exception", e); } return exportDropConfig; }  @JsonView(View.DropSummary.class) @RequestMapping(method = RequestMethod.GET, value = "/api/drops") Page<Drop> getDrops(
            @RequestParam(value = "repositoryId", required = false) Long repositoryId,
            @RequestParam(value = "imported", required = false) Boolean importedFilter,
            @RequestParam(value = "canceled", required = false) Boolean canceledFilter,
            @PageableDefault(sort = "id", direction = Sort.Direction.DESC) Pageable pageable); @RequestMapping(method = RequestMethod.POST, value = "/api/drops/export") ExportDropConfig exportDrop(@RequestBody ExportDropConfig exportDropConfig); @RequestMapping(method = RequestMethod.POST, value = "/api/drops/import") ImportDropConfig importDrop(@RequestBody ImportDropConfig importDropConfig); @RequestMapping(method = RequestMethod.POST, value = "/api/drops/cancel") CancelDropConfig cancelDrop(@RequestBody CancelDropConfig cancelDropConfig); @RequestMapping(value = "/api/drops/complete/{dropId}", method = RequestMethod.POST) void completeDropById(@PathVariable Long dropId); @RequestMapping(method = RequestMethod.POST, value = "/api/drops/importXliff") ImportXliffBody importXliff(@RequestBody ImportXliffBody importXliffBody); }
DropWS { @RequestMapping(method = RequestMethod.POST, value = "/api/drops/export") public ExportDropConfig exportDrop(@RequestBody ExportDropConfig exportDropConfig) throws DropExporterException { PollableFuture<Drop> exportDropFuture = dropService.startDropExportProcess(exportDropConfig, PollableTask.INJECT_CURRENT_TASK); exportDropConfig.setPollableTask(exportDropFuture.getPollableTask()); try { exportDropConfig.setDropId(exportDropFuture.get().getId()); } catch (ExecutionException | InterruptedException e) { logger.debug("Cannot get dropId from the pollable due to exception", e); } return exportDropConfig; }  @JsonView(View.DropSummary.class) @RequestMapping(method = RequestMethod.GET, value = "/api/drops") Page<Drop> getDrops(
            @RequestParam(value = "repositoryId", required = false) Long repositoryId,
            @RequestParam(value = "imported", required = false) Boolean importedFilter,
            @RequestParam(value = "canceled", required = false) Boolean canceledFilter,
            @PageableDefault(sort = "id", direction = Sort.Direction.DESC) Pageable pageable); @RequestMapping(method = RequestMethod.POST, value = "/api/drops/export") ExportDropConfig exportDrop(@RequestBody ExportDropConfig exportDropConfig); @RequestMapping(method = RequestMethod.POST, value = "/api/drops/import") ImportDropConfig importDrop(@RequestBody ImportDropConfig importDropConfig); @RequestMapping(method = RequestMethod.POST, value = "/api/drops/cancel") CancelDropConfig cancelDrop(@RequestBody CancelDropConfig cancelDropConfig); @RequestMapping(value = "/api/drops/complete/{dropId}", method = RequestMethod.POST) void completeDropById(@PathVariable Long dropId); @RequestMapping(method = RequestMethod.POST, value = "/api/drops/importXliff") ImportXliffBody importXliff(@RequestBody ImportXliffBody importXliffBody);  }