@Test public void delete() { LOG.info("\n===UserDaoTest.delete===\n"); LOG.info("Users before delete: "); List<User> users = ESSuiteTest.userDao.getList(); for (User user : users) { LOG.info(" {}", user.toString()); } ESSuiteTest.userDao.delete(ESSuiteTest.USER_2); LOG.info("Users after delete: "); users = ESSuiteTest.userDao.getList(); for (User user : users) { LOG.info(" {}", user.toString()); } assertEquals(1, users.size()); }
public boolean delete( String username ) { DeleteResponse response = elasticSearchClient.getClient() .prepareDelete( DAO_INDEX_KEY, DAO_TYPE_KEY, username ) .setRefresh( true ) .execute() .actionGet(); return response.isFound(); }
UserDao extends Dao { public boolean delete( String username ) { DeleteResponse response = elasticSearchClient.getClient() .prepareDelete( DAO_INDEX_KEY, DAO_TYPE_KEY, username ) .setRefresh( true ) .execute() .actionGet(); return response.isFound(); } }
UserDao extends Dao { public boolean delete( String username ) { DeleteResponse response = elasticSearchClient.getClient() .prepareDelete( DAO_INDEX_KEY, DAO_TYPE_KEY, username ) .setRefresh( true ) .execute() .actionGet(); return response.isFound(); } @Inject  UserDao( IElasticSearchClient elasticSearchClient ); }
UserDao extends Dao { public boolean delete( String username ) { DeleteResponse response = elasticSearchClient.getClient() .prepareDelete( DAO_INDEX_KEY, DAO_TYPE_KEY, username ) .setRefresh( true ) .execute() .actionGet(); return response.isFound(); } @Inject  UserDao( IElasticSearchClient elasticSearchClient ); boolean save( User user ); User get( String username ); List<User> getList(); boolean delete( String username ); }
UserDao extends Dao { public boolean delete( String username ) { DeleteResponse response = elasticSearchClient.getClient() .prepareDelete( DAO_INDEX_KEY, DAO_TYPE_KEY, username ) .setRefresh( true ) .execute() .actionGet(); return response.isFound(); } @Inject  UserDao( IElasticSearchClient elasticSearchClient ); boolean save( User user ); User get( String username ); List<User> getList(); boolean delete( String username ); static final String DAO_INDEX_KEY; static final String DAO_TYPE_KEY; }