@Test public void optionalFieldsIOException() throws Exception {
RealResponseReader<Map<String, Object>> responseReader = responseReader(Collections.<String, Object>emptyMap());
responseReader.readString(ResponseField.forString("stringField", "stringField", null, true, NO_CONDITIONS));
responseReader.readInt(ResponseField.forInt("intField", "intField", null, true, NO_CONDITIONS));
responseReader.readLong(ResponseField.forLong("longField", "longField", null, true, NO_CONDITIONS));
responseReader.readDouble(ResponseField.forDouble("doubleField", "doubleField", null, true, NO_CONDITIONS));
responseReader.readBoolean(ResponseField.forBoolean("booleanField", "booleanField", null, true, NO_CONDITIONS));
responseReader.readObject(ResponseField.forObject("objectField", "objectField", null, true, NO_CONDITIONS), new ResponseReader.ObjectReader<Object>() {
@Override public Object read(ResponseReader reader) {
return null;
}
});
responseReader.readList(ResponseField.forList("scalarListField", "scalarListField", null, true, NO_CONDITIONS), new ResponseReader.ListReader() {
@Override public Object read(ResponseReader.ListItemReader reader) {
return null;
}
});
responseReader.readCustomType((ResponseField.CustomTypeField) ResponseField.forCustomType("customTypeField", "customTypeField",
null, true, DATE_CUSTOM_TYPE, NO_CONDITIONS));
}