@Test public void testDelete() throws TechnicalException { Credential credential = new Credential(); credential.setCredentialId("credentialId"); Credential credentialCreated = credentialRepository.create(credential).blockingGet(); TestObserver<Credential> testObserver = credentialRepository.findById(credentialCreated.getId()).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(c -> c.getCredentialId().equals(credentialCreated.getCredentialId())); TestObserver testObserver1 = credentialRepository.delete(credentialCreated.getId()).test(); testObserver1.awaitTerminalEvent(); credentialRepository.findById(credentialCreated.getId()).test().assertEmpty(); }
@Override public Completable delete(String id) { return Completable.fromPublisher(credentialsCollection.deleteOne(eq(FIELD_ID, id))); }
MongoCredentialRepository extends AbstractManagementMongoRepository implements CredentialRepository { @Override public Completable delete(String id) { return Completable.fromPublisher(credentialsCollection.deleteOne(eq(FIELD_ID, id))); } }
MongoCredentialRepository extends AbstractManagementMongoRepository implements CredentialRepository { @Override public Completable delete(String id) { return Completable.fromPublisher(credentialsCollection.deleteOne(eq(FIELD_ID, id))); }  }
MongoCredentialRepository extends AbstractManagementMongoRepository implements CredentialRepository { @Override public Completable delete(String id) { return Completable.fromPublisher(credentialsCollection.deleteOne(eq(FIELD_ID, id))); }  @PostConstruct void init(); @Override Single<List<Credential>> findByUserId(ReferenceType referenceType, String referenceId, String userId); @Override Single<List<Credential>> findByUsername(ReferenceType referenceType, String referenceId, String username); @Override Single<List<Credential>> findByCredentialId(ReferenceType referenceType, String referenceId, String credentialId); @Override Maybe<Credential> findById(String id); @Override Single<Credential> create(Credential item); @Override Single<Credential> update(Credential item); @Override Completable delete(String id); }
MongoCredentialRepository extends AbstractManagementMongoRepository implements CredentialRepository { @Override public Completable delete(String id) { return Completable.fromPublisher(credentialsCollection.deleteOne(eq(FIELD_ID, id))); }  @PostConstruct void init(); @Override Single<List<Credential>> findByUserId(ReferenceType referenceType, String referenceId, String userId); @Override Single<List<Credential>> findByUsername(ReferenceType referenceType, String referenceId, String username); @Override Single<List<Credential>> findByCredentialId(ReferenceType referenceType, String referenceId, String credentialId); @Override Maybe<Credential> findById(String id); @Override Single<Credential> create(Credential item); @Override Single<Credential> update(Credential item); @Override Completable delete(String id);  }