@Test public void receiveInputStream() throws Exception { Message<String> event = new Message<String>(0, 1L, 2, 3L, "message"); byte[] input = mapper.writeValueAsBytes(event); underTest.receiveByteArray(input); verify(eventHandler).onEvent(event); }
void receiveByteArray(byte[] input) { try { Event event = mapper.readValue(input, Event.class); receive(event); } catch (IOException e) { log.error("Could not deserialise Event", e); throw new UncheckedIOException(e); } }
WebSocket implements AutoCloseable { void receiveByteArray(byte[] input) { try { Event event = mapper.readValue(input, Event.class); receive(event); } catch (IOException e) { log.error("Could not deserialise Event", e); throw new UncheckedIOException(e); } } }
WebSocket implements AutoCloseable { void receiveByteArray(byte[] input) { try { Event event = mapper.readValue(input, Event.class); receive(event); } catch (IOException e) { log.error("Could not deserialise Event", e); throw new UncheckedIOException(e); } } WebSocket(
      String username,
      String password,
      URI uri,
      ObjectMapper mapper,
      TLSConfig.Factory tlsConfigFactory,
      long keepAliveSeconds,
      EventHandler eventHandler,
      ErrorHandler errorHandler,
      CloseHandler closeHandler); }
WebSocket implements AutoCloseable { void receiveByteArray(byte[] input) { try { Event event = mapper.readValue(input, Event.class); receive(event); } catch (IOException e) { log.error("Could not deserialise Event", e); throw new UncheckedIOException(e); } } WebSocket(
      String username,
      String password,
      URI uri,
      ObjectMapper mapper,
      TLSConfig.Factory tlsConfigFactory,
      long keepAliveSeconds,
      EventHandler eventHandler,
      ErrorHandler errorHandler,
      CloseHandler closeHandler); @Override void close(); }
WebSocket implements AutoCloseable { void receiveByteArray(byte[] input) { try { Event event = mapper.readValue(input, Event.class); receive(event); } catch (IOException e) { log.error("Could not deserialise Event", e); throw new UncheckedIOException(e); } } WebSocket(
      String username,
      String password,
      URI uri,
      ObjectMapper mapper,
      TLSConfig.Factory tlsConfigFactory,
      long keepAliveSeconds,
      EventHandler eventHandler,
      ErrorHandler errorHandler,
      CloseHandler closeHandler); @Override void close();  }