LocationsHandler implements RequestHandler<KinesisEvent, List<String>> { private void write(Location location) { try { Futures.addCallback( producer.addUserRecord( streamName, location.getAppUID(), ByteBuffer.wrap(JsonUtils.write(location))), callback); } catch (JsonProcessingException e) { logger.error("Can't prepare location for writing", e); } } LocationsHandler(); @Override List<String> handleRequest(KinesisEvent event, Context context);  }
@Test public void shouldConvertLocation() throws IOException { Location expected = getLocation(); assertEquals(expected, JsonUtils.read(JsonUtils.write(expected), Location.class)); }