@Test public void getSelfTestError() { PersistentChannel channel = mock(PersistentChannel.class); when(channel.sendMessage(any())).thenReturn(false); RadixJsonRpcClient jsonRpcClient = new RadixJsonRpcClient(channel); TestObserver<NodeRunnerData> observer = new TestObserver<>(); jsonRpcClient.getInfo().subscribe(observer); observer.assertValueCount(0); observer.assertError(t -> true); }
public Single<NodeRunnerData> getInfo() { return this.jsonRpcCall("Network.getInfo") .map(JsonRpcResponse::getResult) .map(result -> Serialize.getInstance().fromJson(result.toString(), RadixSystem.class)) .map(NodeRunnerData::new); }
RadixJsonRpcClient { public Single<NodeRunnerData> getInfo() { return this.jsonRpcCall("Network.getInfo") .map(JsonRpcResponse::getResult) .map(result -> Serialize.getInstance().fromJson(result.toString(), RadixSystem.class)) .map(NodeRunnerData::new); } }
RadixJsonRpcClient { public Single<NodeRunnerData> getInfo() { return this.jsonRpcCall("Network.getInfo") .map(JsonRpcResponse::getResult) .map(result -> Serialize.getInstance().fromJson(result.toString(), RadixSystem.class)) .map(NodeRunnerData::new); } RadixJsonRpcClient(PersistentChannel channel); }
RadixJsonRpcClient { public Single<NodeRunnerData> getInfo() { return this.jsonRpcCall("Network.getInfo") .map(JsonRpcResponse::getResult) .map(result -> Serialize.getInstance().fromJson(result.toString(), RadixSystem.class)) .map(NodeRunnerData::new); } RadixJsonRpcClient(PersistentChannel channel); Single<JsonRpcResponse> jsonRpcCall(String method, JsonElement params); Single<JsonRpcResponse> jsonRpcCall(String method); Single<Integer> apiVersion(); Single<RadixUniverseConfig> universe(); Single<NodeRunnerData> getInfo(); Single<List<NodeRunnerData>> getLivePeers(); Completable pushAtom(Atom atom); Completable sendGetAtomStatusNotifications(String subscriberId, AID aid); Completable closeAtomStatusNotifications(String subscriberId); Observable<Notification<AtomStatusEvent>> observeAtomStatusNotifications(String subscriberId); Single<AtomStatus> getAtomStatus(AID aid); Maybe<Atom> getAtom(EUID hid); Observable<Notification<AtomObservation>> observeAtoms(String subscriberId); Completable cancelAtomsSubscribe(String subscriberId); Completable sendAtomsSubscribe(String subscriberId, AtomQuery atomQuery); }
RadixJsonRpcClient { public Single<NodeRunnerData> getInfo() { return this.jsonRpcCall("Network.getInfo") .map(JsonRpcResponse::getResult) .map(result -> Serialize.getInstance().fromJson(result.toString(), RadixSystem.class)) .map(NodeRunnerData::new); } RadixJsonRpcClient(PersistentChannel channel); Single<JsonRpcResponse> jsonRpcCall(String method, JsonElement params); Single<JsonRpcResponse> jsonRpcCall(String method); Single<Integer> apiVersion(); Single<RadixUniverseConfig> universe(); Single<NodeRunnerData> getInfo(); Single<List<NodeRunnerData>> getLivePeers(); Completable pushAtom(Atom atom); Completable sendGetAtomStatusNotifications(String subscriberId, AID aid); Completable closeAtomStatusNotifications(String subscriberId); Observable<Notification<AtomStatusEvent>> observeAtomStatusNotifications(String subscriberId); Single<AtomStatus> getAtomStatus(AID aid); Maybe<Atom> getAtom(EUID hid); Observable<Notification<AtomObservation>> observeAtoms(String subscriberId); Completable cancelAtomsSubscribe(String subscriberId); Completable sendAtomsSubscribe(String subscriberId, AtomQuery atomQuery); static final Integer API_VERSION; }