@Test public void shouldNotFindCode() { String code = "unknownCode"; authorizationCodeRepository.findByCode(code).test().assertEmpty(); }
@Override public Maybe<AuthorizationCode> findByCode(String code) { return Observable.fromPublisher(authorizationCodeCollection.find(eq(FIELD_CODE, code)).first()).firstElement().map(this::convert); }
MongoAuthorizationCodeRepository extends AbstractOAuth2MongoRepository implements AuthorizationCodeRepository { @Override public Maybe<AuthorizationCode> findByCode(String code) { return Observable.fromPublisher(authorizationCodeCollection.find(eq(FIELD_CODE, code)).first()).firstElement().map(this::convert); } }
MongoAuthorizationCodeRepository extends AbstractOAuth2MongoRepository implements AuthorizationCodeRepository { @Override public Maybe<AuthorizationCode> findByCode(String code) { return Observable.fromPublisher(authorizationCodeCollection.find(eq(FIELD_CODE, code)).first()).firstElement().map(this::convert); }  }
MongoAuthorizationCodeRepository extends AbstractOAuth2MongoRepository implements AuthorizationCodeRepository { @Override public Maybe<AuthorizationCode> findByCode(String code) { return Observable.fromPublisher(authorizationCodeCollection.find(eq(FIELD_CODE, code)).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Single<AuthorizationCode> create(AuthorizationCode authorizationCode); @Override Maybe<AuthorizationCode> delete(String code); @Override Maybe<AuthorizationCode> findByCode(String code); }
MongoAuthorizationCodeRepository extends AbstractOAuth2MongoRepository implements AuthorizationCodeRepository { @Override public Maybe<AuthorizationCode> findByCode(String code) { return Observable.fromPublisher(authorizationCodeCollection.find(eq(FIELD_CODE, code)).first()).firstElement().map(this::convert); }  @PostConstruct void init(); @Override Single<AuthorizationCode> create(AuthorizationCode authorizationCode); @Override Maybe<AuthorizationCode> delete(String code); @Override Maybe<AuthorizationCode> findByCode(String code);  }