@SuppressWarnings("unchecked") @Test public void testSearch() { final List<AssetCategory> assetCategories = new ArrayList<>(); final AssetCategory assetCategory = getAssetCategory(); assetCategories.add(assetCategory); when(assetCategoryQueryBuilder.getQuery(any(AssetCategoryCriteria.class), any(List.class))) .thenReturn(StringUtils.EMPTY); when(jdbcTemplate.query(any(String.class), any(Object[].class), any(AssetCategoryRowMapper.class))) .thenReturn(assetCategories); assertTrue(assetCategories.equals(assetCategoryRepository.search(new AssetCategoryCriteria()))); }
public List<AssetCategory> search(final AssetCategoryCriteria assetCategoryCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = assetCategoryQueryBuilder.getQuery(assetCategoryCriteria, preparedStatementValues); List<AssetCategory> assetCategory = new ArrayList<>(); try { assetCategory = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), assetCategoryRowMapper); } catch (final Exception exception) { log.info("the exception in assetcategory search :" + exception); throw new RuntimeException("the exception in assetcategory search"); } return assetCategory; }
AssetCategoryRepository { public List<AssetCategory> search(final AssetCategoryCriteria assetCategoryCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = assetCategoryQueryBuilder.getQuery(assetCategoryCriteria, preparedStatementValues); List<AssetCategory> assetCategory = new ArrayList<>(); try { assetCategory = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), assetCategoryRowMapper); } catch (final Exception exception) { log.info("the exception in assetcategory search :" + exception); throw new RuntimeException("the exception in assetcategory search"); } return assetCategory; } }
AssetCategoryRepository { public List<AssetCategory> search(final AssetCategoryCriteria assetCategoryCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = assetCategoryQueryBuilder.getQuery(assetCategoryCriteria, preparedStatementValues); List<AssetCategory> assetCategory = new ArrayList<>(); try { assetCategory = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), assetCategoryRowMapper); } catch (final Exception exception) { log.info("the exception in assetcategory search :" + exception); throw new RuntimeException("the exception in assetcategory search"); } return assetCategory; }  }
AssetCategoryRepository { public List<AssetCategory> search(final AssetCategoryCriteria assetCategoryCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = assetCategoryQueryBuilder.getQuery(assetCategoryCriteria, preparedStatementValues); List<AssetCategory> assetCategory = new ArrayList<>(); try { assetCategory = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), assetCategoryRowMapper); } catch (final Exception exception) { log.info("the exception in assetcategory search :" + exception); throw new RuntimeException("the exception in assetcategory search"); } return assetCategory; }  List<AssetCategory> search(final AssetCategoryCriteria assetCategoryCriteria); AssetCategory create(final AssetCategoryRequest assetCategoryRequest); AssetCategory update(final AssetCategoryRequest assetCategoryRequest); }
AssetCategoryRepository { public List<AssetCategory> search(final AssetCategoryCriteria assetCategoryCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = assetCategoryQueryBuilder.getQuery(assetCategoryCriteria, preparedStatementValues); List<AssetCategory> assetCategory = new ArrayList<>(); try { assetCategory = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), assetCategoryRowMapper); } catch (final Exception exception) { log.info("the exception in assetcategory search :" + exception); throw new RuntimeException("the exception in assetcategory search"); } return assetCategory; }  List<AssetCategory> search(final AssetCategoryCriteria assetCategoryCriteria); AssetCategory create(final AssetCategoryRequest assetCategoryRequest); AssetCategory update(final AssetCategoryRequest assetCategoryRequest);  }