NonBlockingClient { public abstract <T> boolean sendJson(String topic, String json, Map<String, Object> properties, SendOptions sendOptions, CompletionListener<T> listener, T context) throws StoppedException, IllegalArgumentException;  static NonBlockingClient create(String service, ClientOptions options,
            NonBlockingClientListener<T> listener, T context); static NonBlockingClient create(EndpointService endpointService,
                                               CallbackService callbackService,
                                               NetworkService networkService,
                                               TimerService timerService,
                                               GsonBuilder gsonBuilder,
                                               ClientOptions options,
                                               NonBlockingClientListener<T>listener,
                                               T context); static NonBlockingClient create(String service, NonBlockingClientListener<T> listener, T context); abstract String getId(); abstract String getService(); abstract ClientState getState(); abstract boolean send(String topic, String data, Map<String, Object> properties, SendOptions sendOptions, CompletionListener<T> listener, T context); abstract boolean send(String topic, ByteBuffer data, Map<String, Object> properties, SendOptions sendOptions, CompletionListener<T> listener, T context); abstract boolean send(String topic, Object json, Map<String, Object> properties, SendOptions sendOptions, CompletionListener<T> listener, T context); abstract boolean send(String topic, Object json, Type type, Map<String, Object> properties, SendOptions sendOptions, CompletionListener<T> listener, T context); abstract boolean sendJson(String topic, String json, Map<String, Object> properties, SendOptions sendOptions, CompletionListener<T> listener, T context); boolean send(String topic, String data, Map<String, Object> properties, CompletionListener<T> listener, T context); boolean send(String topic, ByteBuffer data, Map<String, Object> properties, CompletionListener<T> listener, T context); boolean send(String topic, Object json, Map<String, Object> properties, CompletionListener<T> listener, T context); boolean send(String topic, Object json, Type type, Map<String, Object> properties, CompletionListener<T> listener, T context); boolean sendJson(String topic, String json, Map<String, Object> properties, CompletionListener<T> listener, T context); boolean send(String topic, String data, Map<String, Object> properties); boolean send(String topic, ByteBuffer data, Map<String, Object> properties); boolean send(String topic, Object json, Map<String, Object> properties); boolean send(String topic, Object json, Type type, Map<String, Object> properties); boolean sendJson(String topic, String json, Map<String, Object> properties); abstract NonBlockingClient start(CompletionListener<T> listener, T context); abstract void stop(CompletionListener<T> listener, T context); abstract NonBlockingClient subscribe(String topicPattern, SubscribeOptions subOptions,
                                                    DestinationListener<T> destListener, CompletionListener<T> compListener, T context); NonBlockingClient subscribe(String topicPattern, DestinationListener<T> destListener, CompletionListener<T> compListener, T context); abstract NonBlockingClient unsubscribe(String topicPattern, String share, int ttl, CompletionListener<T> listener, T context); NonBlockingClient unsubscribe(String topicPattern, int ttl, CompletionListener<T> listener, T context); abstract NonBlockingClient unsubscribe(String topicPattern, String share, CompletionListener<T> listener, T context); NonBlockingClient unsubscribe(String topicPattern, CompletionListener<T> listener, T context);  }
@Test public void send11() { String topic = "topic"; String data = "[1, 2, 3]"; HashMap<String, Object> properties = new HashMap<String, Object>(); StubCompletionListener listener = new StubCompletionListener(); Object context = new Object(); MockNonBlockingClient client = new MockNonBlockingClient(new Object[] {"sendJson", topic, data, properties, NonBlockingClient.defaultSendOptions, listener, context}); client.sendJson(topic, data, properties, listener, context); }
@Test public void send12() { String topic = "topic"; String data = "[1, 2, 3]"; HashMap<String, Object> properties = new HashMap<String, Object>(); StubCompletionListener listener = new StubCompletionListener(); Object context = new Object(); SendOptions sendOptions = SendOptions.builder().build(); MockNonBlockingClient client = new MockNonBlockingClient(new Object[] {"sendJson", topic, data, properties, sendOptions, listener, context}); client.sendJson(topic, data, properties, sendOptions, listener, context); }
@Test public void send13() { String topic = "topic"; String data = "[1, 2, 3]"; HashMap<String, Object> properties = new HashMap<String, Object>(); MockNonBlockingClient client = new MockNonBlockingClient(new Object[] {"sendJson", topic, data, properties, NonBlockingClient.defaultSendOptions, null, null}); client.sendJson(topic, data, properties); }