@Test public void checkBindIntentWillContainCorrectChannel() { Intent bindIntent = observableWebSocketClient.getServiceIntent("7878"); assertThat(bindIntent).isNotNull(); assertThat(bindIntent.hasExtra(KEY_CHANNEL_TYPE)).isTrue(); assertThat(bindIntent.getStringExtra(KEY_CHANNEL_TYPE)).isEqualTo(CHANNEL_WEBSOCKET); assertThat(bindIntent.hasExtra(KEY_CLIENT_ID)).isTrue(); assertThat(bindIntent.getStringExtra(KEY_CLIENT_ID)).isEqualTo("7878"); }
@NonNull protected Intent getServiceIntent(String clientId) { Intent intent = super.getServiceIntent(clientId); intent.putExtra(KEY_CHANNEL_TYPE, CHANNEL_WEBSOCKET); return intent; }
ObservableWebSocketClient extends ObservableMessengerClient { @NonNull protected Intent getServiceIntent(String clientId) { Intent intent = super.getServiceIntent(clientId); intent.putExtra(KEY_CHANNEL_TYPE, CHANNEL_WEBSOCKET); return intent; } }
ObservableWebSocketClient extends ObservableMessengerClient { @NonNull protected Intent getServiceIntent(String clientId) { Intent intent = super.getServiceIntent(clientId); intent.putExtra(KEY_CHANNEL_TYPE, CHANNEL_WEBSOCKET); return intent; } ObservableWebSocketClient(Context context, ComponentName serviceComponentName); }
ObservableWebSocketClient extends ObservableMessengerClient { @NonNull protected Intent getServiceIntent(String clientId) { Intent intent = super.getServiceIntent(clientId); intent.putExtra(KEY_CHANNEL_TYPE, CHANNEL_WEBSOCKET); return intent; } ObservableWebSocketClient(Context context, ComponentName serviceComponentName); @Override Completable connect(); @Override boolean isConnected(); @Override Observable<String> sendMessage(final String message); @Override void closeConnection(); }
ObservableWebSocketClient extends ObservableMessengerClient { @NonNull protected Intent getServiceIntent(String clientId) { Intent intent = super.getServiceIntent(clientId); intent.putExtra(KEY_CHANNEL_TYPE, CHANNEL_WEBSOCKET); return intent; } ObservableWebSocketClient(Context context, ComponentName serviceComponentName); @Override Completable connect(); @Override boolean isConnected(); @Override Observable<String> sendMessage(final String message); @Override void closeConnection();  }