FeedServiceImpl implements IFeedService { @Override public void delete(String id) { ProjectLogger.log( "FeedServiceImpl:delete method called for feedId : " + id, LoggerEnum.INFO.name()); getCassandraInstance() .deleteRecord(usrFeedDbInfo.getKeySpace(), usrFeedDbInfo.getTableName(), id); getESInstance().delete(ProjectUtil.EsType.userfeed.getTypeName(), id); }  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 testDelete() { boolean response = false; try { feedService.delete("123-456-789"); response = true; } catch (Exception ex) { Assert.assertTrue(response); } Assert.assertTrue(response); }