use of com.codingchili.core.context.StorageContext in project chili-core by codingchili.
the class EntryWatcherTest method setUp.
@Before
public void setUp(TestContext test) {
Async async = test.async();
context = new StorageContext();
createStorage(result -> {
if (result.succeeded()) {
this.storage = result.result();
getQuery().poll(entry -> entry.forEach(item -> {
storage.remove(item.getId(), removed -> {
});
}), () -> REMOVE_INTERVAL);
storage.put(object, put -> {
test.assertTrue(put.succeeded());
async.complete();
});
} else {
test.fail(result.cause());
}
});
}
use of com.codingchili.core.context.StorageContext in project chili-core by codingchili.
the class ContextMock method getRealmStore.
@Override
public void getRealmStore(Handler<AsyncResult<AsyncRealmStore>> handler) {
new StorageLoader<RegisteredRealm>().privatemap(new StorageContext<>(this)).withValue(RegisteredRealm.class).withDB("", "").build(result -> {
this.realms = new RealmDB(result.result());
RegisteredRealm realm = new RegisteredRealm().setName("realmName").setAuthentication(new Token(new TokenFactory("s".getBytes()), "realmName"));
realms.put(Future.future(), realm);
handler.handle(Future.succeededFuture(realms));
});
}
Aggregations