LgoStreamingService extends JsonNettyStreamingService { @Override public String getSubscribeMessage(String channelName, Object... args) throws IOException { return getObjectMapper().writeValueAsString(LgoSubscription.subscribe(channelName)); } LgoStreamingService(LgoSignatureService signatureService, String apiUrl); @Override String getSubscribeMessage(String channelName, Object... args); @Override String getUnsubscribeMessage(String channelName);  }
@Test public void it_returns_the_trades_subscribe_message() throws IOException { String channelName = "trades-BTC-USD"; String subscribeMessage = service.getSubscribeMessage(channelName); assertThat(asJsonNode(subscribeMessage)) .isEqualTo(getJsonContent("/subscribe/trades-subscribe.json")); }
@Test public void it_returns_the_level2_subscribe_message() throws IOException { String channelName = "level2-BTC-USD"; String subscribeMessage = service.getSubscribeMessage(channelName); assertThat(asJsonNode(subscribeMessage)) .isEqualTo(getJsonContent("/subscribe/level2-subscribe.json")); }
@Test public void it_returns_the_balance_subscribe_message() throws IOException { String channelName = "balance"; String subscribeMessage = service.getSubscribeMessage(channelName); assertThat(asJsonNode(subscribeMessage)) .isEqualTo(getJsonContent("/subscribe/balance-subscribe.json")); }