### Question:
AbstractConnectorHandler implements RequestStreamHandler { Event readEvent(InputStream input) throws ErrorResponseException { String streamPreview = null; try { input = Payload.prepareInputStream(input); streamPreview = previewInput(input); Event receivedEvent = XyzSerializable.deserialize(input); logger.info("{} [{} ms] - Parsed event: {}", receivedEvent.getStreamId(), ms(), streamPreview); return receivedEvent; } catch (JsonMappingException e) { logger.error("{} [{} ms] - Exception {} occurred while reading the event: {}", "FATAL", ms(), e.getMessage(), streamPreview, e); throw new ErrorResponseException(streamId, XyzError.ILLEGAL_ARGUMENT, "Unknown event type"); } catch (ClassCastException e) { logger.error("{} [{} ms] - Exception {} occurred while reading the event: {}", "FATAL", ms(), e.getMessage(), streamPreview, e); throw new ErrorResponseException(streamId, XyzError.ILLEGAL_ARGUMENT, "The input should be of type Event"); } catch (Exception e) { logger.error("{} [{} ms] - Exception {} occurred while reading the event: {}", "FATAL", ms(), e.getMessage(), streamPreview, e); throw new ErrorResponseException(streamId, XyzError.EXCEPTION, e); } } AbstractConnectorHandler(); @SuppressWarnings("unused") void setEmbedded(boolean embedded); @Override void handleRequest(InputStream input, OutputStream output, Context context); @SuppressWarnings("WeakerAccess")
  static final String RESPONSE; static final String ENV_DECRYPTOR; @SuppressWarnings("WeakerAccess")
  static int MAX_RESPONSE_SIZE; @SuppressWarnings("WeakerAccess")
  static int MIN_COMPRESS_SIZE; }### Answer:
@Test public void readEvent() { InputStream is = new ByteArrayInputStream(HealthCheckEventString.getBytes()); TestStorageConnector testStorageConnector = new TestStorageConnector(); try { Event<?> event = testStorageConnector.readEvent(is); assertTrue(event instanceof HealthCheckEvent); } catch (ErrorResponseException e) { e.printStackTrace(); fail("Expected was that a HealthCheckEvent object will be created."); } }