OkCoinStreamingService extends JsonNettyStreamingService { @Override public String getUnsubscribeMessage(String channelName) throws IOException { WebSocketMessage webSocketMessage = new WebSocketMessage("removeChannel", channelName); return objectMapper.writeValueAsString(webSocketMessage); } OkCoinStreamingService(String apiUrl); @Override Completable connect(); @Override String getSubscribeMessage(String channelName, Object... args); @Override String getUnsubscribeMessage(String channelName);  }
@Test public void testGetUnsubscribeMessage() throws Exception { String subscribeMessage = streamingService.getUnsubscribeMessage("orderbook"); String expected = new String( Files.readAllBytes( Paths.get(ClassLoader.getSystemResource("unsubscribe.json").toURI()))); assertThat(subscribeMessage).isEqualTo(expected); }