request.setMethod(Method.GET);
ResponseImpl response = new ResponseImpl();
handler.handle(request, response);
response.consumeBody();
JafSerializableObj testobj = null;
//deserialize object
try {
InputStream is = new ByteArrayInputStream(response.getBodyBytes());
ObjectInput oi = new ObjectInputStream(is);
testobj = (JafSerializableObj) oi.readObject();
oi.close();
} catch (ClassNotFoundException e) {
System.out.println("TestJAFProvider: " + e.toString());
assertTrue(false);
} catch (StreamCorruptedException e) {
System.out.println("TestJAFProvider: " + e.toString());
e.printStackTrace();
assertTrue(false);
}
assertEquals("Object", testobj.getField1());
assertEquals("Test", testobj.getField2());
}