MongoRolePersonRepository2 implements RolePersonRepository2 { @Override public Role2 findOne(String id) { final BasicDBObject query = new BasicDBObject(); query.put("_id", id); log.debug("Find One Role by id '{}' - query: {}", id, query); final DBObject dbObject = rolePersonColl.findOne(query); final Role2 role = new DBObjectToEntity().apply(dbObject); return role; } MongoRolePersonRepository2(final String mongoUri); @Override List<Role2> addAll(List<Role2> upRoleList); @Override List<Role2> findAll(); @Override Page<Role2> findAll(String searchText, Pageable pageable); @Override long count(String searchText); @Override Role2 findOne(String id); @Override //method Role2 add(Role2 roleBaru); @Override Role2 modify(String id, Role2 upRole); @Override Role2 addDomain(String id, Role2 upRole);  }
@Test public void findOneById() { final String id = "admin"; final Role2 role = rolePersonRepo.findOne(id); log.info("Find one by id '{}': {}", id, role); }