use of io.knotx.reactivex.proxy.KnotProxy in project knotx by Cognifide.
the class FragmentAssemblerTest method callAssemblerWithAssertions.
private void callAssemblerWithAssertions(TestContext context, List<Pair<List<String>, String>> fragments, Action1<KnotContext> testFunction) {
Async async = context.async();
KnotProxy service = KnotProxy.createProxy(new Vertx(vertx.vertx()), ADDRESS);
service.rxProcess(KnotContextFactory.create(fragments)).map(ctx -> Pair.of(async, ctx)).doOnSuccess(success -> testFunction.call(success.getRight())).subscribe(success -> async.complete(), context::fail);
}
use of io.knotx.reactivex.proxy.KnotProxy in project knotx by Cognifide.
the class HtmlFragmentSplitterVerticleTest method callFragmentSplitterWithAssertions.
private void callFragmentSplitterWithAssertions(TestContext context, String template, Action1<KnotContext> testFunction) {
Async async = context.async();
KnotProxy service = KnotProxy.createProxy(new Vertx(vertx.vertx()), ADDRESS);
service.rxProcess(KnotContextFactory.empty(template)).map(ctx -> Pair.of(async, ctx)).doOnSuccess(success -> testFunction.call(success.getRight())).subscribe(success -> async.complete(), context::fail);
}
use of io.knotx.reactivex.proxy.KnotProxy in project knotx by Cognifide.
the class ActionKnotProxyVerticleTest method callActionKnotWithAssertions.
private void callActionKnotWithAssertions(TestContext context, KnotContext knotContext, Action1<KnotContext> onSuccess, Consumer<Throwable> onError) {
Async async = context.async();
KnotProxy actionKnot = KnotProxy.createProxy(new Vertx(vertx.vertx()), ADDRESS);
actionKnot.rxProcess(knotContext).doOnSuccess(onSuccess::call).subscribe(success -> async.complete(), onError);
}
Aggregations