@Test public void testCreate() { Entrypoint entrypoint = new Entrypoint(); entrypoint.setName("testName"); TestObserver<Entrypoint> testObserver = entrypointRepository.create(entrypoint).test(); testObserver.awaitTerminalEvent(); testObserver.assertComplete(); testObserver.assertNoErrors(); testObserver.assertValue(entrypointCreated -> entrypointCreated.getName().equals(entrypoint.getName())); }
@Override public Single<Entrypoint> create(Entrypoint item) { EntrypointMongo entrypoint = convert(item); entrypoint.setId(entrypoint.getId() == null ? RandomString.generate() : entrypoint.getId()); return Single.fromPublisher(collection.insertOne(entrypoint)).flatMap(success -> findById(entrypoint.getId()).toSingle()); }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Single<Entrypoint> create(Entrypoint item) { EntrypointMongo entrypoint = convert(item); entrypoint.setId(entrypoint.getId() == null ? RandomString.generate() : entrypoint.getId()); return Single.fromPublisher(collection.insertOne(entrypoint)).flatMap(success -> findById(entrypoint.getId()).toSingle()); } }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Single<Entrypoint> create(Entrypoint item) { EntrypointMongo entrypoint = convert(item); entrypoint.setId(entrypoint.getId() == null ? RandomString.generate() : entrypoint.getId()); return Single.fromPublisher(collection.insertOne(entrypoint)).flatMap(success -> findById(entrypoint.getId()).toSingle()); }  }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Single<Entrypoint> create(Entrypoint item) { EntrypointMongo entrypoint = convert(item); entrypoint.setId(entrypoint.getId() == null ? RandomString.generate() : entrypoint.getId()); return Single.fromPublisher(collection.insertOne(entrypoint)).flatMap(success -> findById(entrypoint.getId()).toSingle()); }  @PostConstruct void init(); @Override Maybe<Entrypoint> findById(String id, String organizationId); @Override Maybe<Entrypoint> findById(String id); @Override Flowable<Entrypoint> findAll(String organizationId); @Override Single<Entrypoint> create(Entrypoint item); @Override Single<Entrypoint> update(Entrypoint item); @Override Completable delete(String id); }
MongoEntrypointRepository extends AbstractManagementMongoRepository implements EntrypointRepository { @Override public Single<Entrypoint> create(Entrypoint item) { EntrypointMongo entrypoint = convert(item); entrypoint.setId(entrypoint.getId() == null ? RandomString.generate() : entrypoint.getId()); return Single.fromPublisher(collection.insertOne(entrypoint)).flatMap(success -> findById(entrypoint.getId()).toSingle()); }  @PostConstruct void init(); @Override Maybe<Entrypoint> findById(String id, String organizationId); @Override Maybe<Entrypoint> findById(String id); @Override Flowable<Entrypoint> findAll(String organizationId); @Override Single<Entrypoint> create(Entrypoint item); @Override Single<Entrypoint> update(Entrypoint item); @Override Completable delete(String id);  }