ApiDeserializer { public ApiDeserializer() { } ApiDeserializer(); static String toHawkularFormat(BasicMessage msg); static BinaryData toHawkularFormat(BasicMessage msg, InputStream extraData); BasicMessageWithExtraData<T> deserialize(String nameAndJson); BasicMessageWithExtraData<T> deserialize(InputStream input);  }
@Test public void testApiDeserializer() { ApiDeserializer ad = new ApiDeserializer(); String nameAndJson = EchoRequest.class.getName() + "={\"echoMessage\":\"msg\"}"; BasicMessage request = ad.deserialize(nameAndJson).getBasicMessage(); Assert.assertTrue(request instanceof EchoRequest); EchoRequest echoRequest = (EchoRequest) request; Assert.assertEquals("msg", echoRequest.getEchoMessage()); }