FeedServiceImpl implements IFeedService { @Override public List<Feed> getRecordsByProperties(Map<String, Object> properties) { ProjectLogger.log( "FeedServiceImpl:getRecordsByProperties method called : ", LoggerEnum.INFO.name()); Response dbResponse = getCassandraInstance() .getRecordsByProperties( usrFeedDbInfo.getKeySpace(), usrFeedDbInfo.getTableName(), properties); List<Map<String, Object>> responseList = null; List<Feed> feedList = new ArrayList<>(); if (null != dbResponse && null != dbResponse.getResult()) { responseList = (List<Map<String, Object>>) dbResponse.getResult().get(JsonKey.RESPONSE); if (CollectionUtils.isNotEmpty(responseList)) { responseList.forEach( s -> { try { String data = (String) s.get(JsonKey.FEED_DATA); if (StringUtils.isNotBlank(data)) { s.put( JsonKey.FEED_DATA, mapper.readValue(data, new TypeReference<Map<String, Object>>() {})); } else { s.put(JsonKey.FEED_DATA, Collections.emptyMap()); } feedList.add(mapper.convertValue(s, Feed.class)); } catch (Exception ex) { ProjectLogger.log( "FeedServiceImpl:getRecordsByProperties :Exception occurred while mapping feed data.", ex); } }); } } return feedList; }  static CassandraOperation getCassandraInstance(); static ElasticSearchService getESInstance(); @Override Response insert(Feed feed); @Override Response update(Feed feed); @Override List<Feed> getRecordsByProperties(Map<String, Object> properties); @Override Response search(SearchDTO searchDTO); @Override void delete(String id);  }
@Test public void testGetRecordsByProperties() { Map<String, Object> props = new HashMap<>(); props.put(JsonKey.USER_ID, "123-456-789"); List<Feed> res = feedService.getRecordsByProperties(props); Assert.assertTrue(res != null); }