@Test public void test_Should_Search_StorageReservoir() { new ArrayList<>(); final List<StorageReservoir> storageReservoirList = new ArrayList<>(); final StorageReservoir storageReservoir = getStorageReservoir(); storageReservoirList.add(storageReservoir); final StorageReservoirGetRequest storageReservoirGetRequest = getStorageReservoirGetCriteria(); when(namedParameterJdbcTemplate.query(any(String.class), anyMap(), any(StorageReservoirRowMapper.class))) .thenReturn(storageReservoirList); assertTrue(storageReservoirRepository.findForCriteria(storageReservoirGetRequest).get(0).getCode() .equals(storageReservoirList.get(0).getCode())); }
public List<StorageReservoir> findForCriteria(final StorageReservoirGetRequest storageReservoirGetRequest) { final Map<String, Object> preparedStatementValues = new HashMap<>(); final String queryStr = storageReservoirQueryBuilder.getQuery(storageReservoirGetRequest, preparedStatementValues); final List<StorageReservoir> storageReservoirList = namedParameterJdbcTemplate.query(queryStr, preparedStatementValues, storageReservoirRowMapper); return storageReservoirList; }
StorageReservoirRepository { public List<StorageReservoir> findForCriteria(final StorageReservoirGetRequest storageReservoirGetRequest) { final Map<String, Object> preparedStatementValues = new HashMap<>(); final String queryStr = storageReservoirQueryBuilder.getQuery(storageReservoirGetRequest, preparedStatementValues); final List<StorageReservoir> storageReservoirList = namedParameterJdbcTemplate.query(queryStr, preparedStatementValues, storageReservoirRowMapper); return storageReservoirList; } }
StorageReservoirRepository { public List<StorageReservoir> findForCriteria(final StorageReservoirGetRequest storageReservoirGetRequest) { final Map<String, Object> preparedStatementValues = new HashMap<>(); final String queryStr = storageReservoirQueryBuilder.getQuery(storageReservoirGetRequest, preparedStatementValues); final List<StorageReservoir> storageReservoirList = namedParameterJdbcTemplate.query(queryStr, preparedStatementValues, storageReservoirRowMapper); return storageReservoirList; }  }
StorageReservoirRepository { public List<StorageReservoir> findForCriteria(final StorageReservoirGetRequest storageReservoirGetRequest) { final Map<String, Object> preparedStatementValues = new HashMap<>(); final String queryStr = storageReservoirQueryBuilder.getQuery(storageReservoirGetRequest, preparedStatementValues); final List<StorageReservoir> storageReservoirList = namedParameterJdbcTemplate.query(queryStr, preparedStatementValues, storageReservoirRowMapper); return storageReservoirList; }  StorageReservoirRequest create(
            final StorageReservoirRequest storageReservoirRequest); StorageReservoirRequest update(
            final StorageReservoirRequest storageReservoirRequest); List<StorageReservoir> findForCriteria(final StorageReservoirGetRequest storageReservoirGetRequest); boolean checkStorageReservoirByNameAndCode(final String code, final String name, final String tenantId); }
StorageReservoirRepository { public List<StorageReservoir> findForCriteria(final StorageReservoirGetRequest storageReservoirGetRequest) { final Map<String, Object> preparedStatementValues = new HashMap<>(); final String queryStr = storageReservoirQueryBuilder.getQuery(storageReservoirGetRequest, preparedStatementValues); final List<StorageReservoir> storageReservoirList = namedParameterJdbcTemplate.query(queryStr, preparedStatementValues, storageReservoirRowMapper); return storageReservoirList; }  StorageReservoirRequest create(
            final StorageReservoirRequest storageReservoirRequest); StorageReservoirRequest update(
            final StorageReservoirRequest storageReservoirRequest); List<StorageReservoir> findForCriteria(final StorageReservoirGetRequest storageReservoirGetRequest); boolean checkStorageReservoirByNameAndCode(final String code, final String name, final String tenantId);  }