@Transactional @Test public void testAllFilters() { TMTestData tmTestData = new TMTestData(testIdWatcher); List<String> localeTags = new ArrayList<>(); localeTags.add("ko-KR"); TextUnitSearcherParameters textUnitSearcherParameters = new TextUnitSearcherParametersForTesting(); textUnitSearcherParameters.setName("zuora_error_message_verify_state_province"); textUnitSearcherParameters.setLocaleTags(localeTags); textUnitSearcherParameters.setTarget("올바른 국가, 지역 또는 시/도를 입력하십시오."); textUnitSearcherParameters.setRepositoryIds(tmTestData.repository.getId()); textUnitSearcherParameters.setSource("Please enter a valid state, region or province"); textUnitSearcherParameters.setUsedFilter(UsedFilter.USED); textUnitSearcherParameters.setStatusFilter(StatusFilter.TRANSLATED); List<TextUnitDTO> textUnitDTOs = textUnitSearcher.search(textUnitSearcherParameters); for (TextUnitDTO textUnitDTO : textUnitDTOs) { logger.debug(ToStringBuilder.reflectionToString(textUnitDTO, ToStringStyle.MULTI_LINE_STYLE)); } Iterator<TextUnitDTO> iterator = textUnitDTOs.iterator(); TextUnitDTO next = iterator.next(); assertEquals(tmTestData.asset.getId(), next.getAssetId()); assertEquals("Comment1", next.getComment()); assertEquals(tmTestData.koKR.getId(), next.getLocaleId()); assertEquals("zuora_error_message_verify_state_province", next.getName()); assertEquals("Please enter a valid state, region or province", next.getSource()); assertEquals("올바른 국가, 지역 또는 시/도를 입력하십시오.", next.getTarget()); assertEquals("ko-KR", next.getTargetLocale()); assertEquals(tmTestData.addTMTextUnit1.getId(), next.getTmTextUnitId()); assertEquals(tmTestData.addCurrentTMTextUnitVariant1KoKR.getId(), next.getTmTextUnitVariantId()); assertTrue(next.isTranslated()); assertTrue(next.isUsed()); assertFalse(iterator.hasNext()); }
@Transactional @Retryable( value = {TextUnitSearcherError.class}, backoff = @Backoff(delay = 500, multiplier = 2)) public List<TextUnitDTO> search(TextUnitSearcherParameters searchParameters) { NativeCriteria c = getCriteriaForSearch(searchParameters); try { logger.debug("Perform query"); List<TextUnitDTO> resultAsList = c.criteriaResult(new TextUnitDTONativeObjectMapper()); if (logger.isDebugEnabled()) { logger.debug("Query done, info: {}", c.getQueryInfo()); } return resultAsList; } catch (Exception e) { logger.warn("TextUnitSearcher failed to search, exception", e); logger.warn("TextUnitSearcher failed to search, query: {}", c.getQueryInfo().toString()); throw new TextUnitSearcherError(c, "search", e); } }
TextUnitSearcher { @Transactional @Retryable( value = {TextUnitSearcherError.class}, backoff = @Backoff(delay = 500, multiplier = 2)) public List<TextUnitDTO> search(TextUnitSearcherParameters searchParameters) { NativeCriteria c = getCriteriaForSearch(searchParameters); try { logger.debug("Perform query"); List<TextUnitDTO> resultAsList = c.criteriaResult(new TextUnitDTONativeObjectMapper()); if (logger.isDebugEnabled()) { logger.debug("Query done, info: {}", c.getQueryInfo()); } return resultAsList; } catch (Exception e) { logger.warn("TextUnitSearcher failed to search, exception", e); logger.warn("TextUnitSearcher failed to search, query: {}", c.getQueryInfo().toString()); throw new TextUnitSearcherError(c, "search", e); } } }
TextUnitSearcher { @Transactional @Retryable( value = {TextUnitSearcherError.class}, backoff = @Backoff(delay = 500, multiplier = 2)) public List<TextUnitDTO> search(TextUnitSearcherParameters searchParameters) { NativeCriteria c = getCriteriaForSearch(searchParameters); try { logger.debug("Perform query"); List<TextUnitDTO> resultAsList = c.criteriaResult(new TextUnitDTONativeObjectMapper()); if (logger.isDebugEnabled()) { logger.debug("Query done, info: {}", c.getQueryInfo()); } return resultAsList; } catch (Exception e) { logger.warn("TextUnitSearcher failed to search, exception", e); logger.warn("TextUnitSearcher failed to search, query: {}", c.getQueryInfo().toString()); throw new TextUnitSearcherError(c, "search", e); } }  }
TextUnitSearcher { @Transactional @Retryable( value = {TextUnitSearcherError.class}, backoff = @Backoff(delay = 500, multiplier = 2)) public List<TextUnitDTO> search(TextUnitSearcherParameters searchParameters) { NativeCriteria c = getCriteriaForSearch(searchParameters); try { logger.debug("Perform query"); List<TextUnitDTO> resultAsList = c.criteriaResult(new TextUnitDTONativeObjectMapper()); if (logger.isDebugEnabled()) { logger.debug("Query done, info: {}", c.getQueryInfo()); } return resultAsList; } catch (Exception e) { logger.warn("TextUnitSearcher failed to search, exception", e); logger.warn("TextUnitSearcher failed to search, query: {}", c.getQueryInfo().toString()); throw new TextUnitSearcherError(c, "search", e); } }  @Retryable( value = {TextUnitSearcherError.class}, backoff = @Backoff(delay = 500, multiplier = 2)) TextUnitAndWordCount countTextUnitAndWordCount(TextUnitSearcherParameters searchParameters); @Recover TextUnitAndWordCount recoverCountTextUnitAndWordCount(TextUnitSearcherError textUnitSearcherError, TextUnitSearcherParameters searchParameters); @Recover List<TextUnitDTO> recoverSearch(TextUnitSearcherError textUnitSearcherError, TextUnitSearcherParameters searchParameters); @Transactional @Retryable( value = {TextUnitSearcherError.class}, backoff = @Backoff(delay = 500, multiplier = 2)) List<TextUnitDTO> search(TextUnitSearcherParameters searchParameters); }
TextUnitSearcher { @Transactional @Retryable( value = {TextUnitSearcherError.class}, backoff = @Backoff(delay = 500, multiplier = 2)) public List<TextUnitDTO> search(TextUnitSearcherParameters searchParameters) { NativeCriteria c = getCriteriaForSearch(searchParameters); try { logger.debug("Perform query"); List<TextUnitDTO> resultAsList = c.criteriaResult(new TextUnitDTONativeObjectMapper()); if (logger.isDebugEnabled()) { logger.debug("Query done, info: {}", c.getQueryInfo()); } return resultAsList; } catch (Exception e) { logger.warn("TextUnitSearcher failed to search, exception", e); logger.warn("TextUnitSearcher failed to search, query: {}", c.getQueryInfo().toString()); throw new TextUnitSearcherError(c, "search", e); } }  @Retryable( value = {TextUnitSearcherError.class}, backoff = @Backoff(delay = 500, multiplier = 2)) TextUnitAndWordCount countTextUnitAndWordCount(TextUnitSearcherParameters searchParameters); @Recover TextUnitAndWordCount recoverCountTextUnitAndWordCount(TextUnitSearcherError textUnitSearcherError, TextUnitSearcherParameters searchParameters); @Recover List<TextUnitDTO> recoverSearch(TextUnitSearcherError textUnitSearcherError, TextUnitSearcherParameters searchParameters); @Transactional @Retryable( value = {TextUnitSearcherError.class}, backoff = @Backoff(delay = 500, multiplier = 2)) List<TextUnitDTO> search(TextUnitSearcherParameters searchParameters);  }