@Test(expected = JsonMappingException.class) public void shouldThrowExceptionWhenFromAddressFieldIsBlank() throws Exception { deserializer.deserialize( getJsonParser(null, TEST_TO, TEST_SUBJECT, TEST_TEXT), null ); }
@Override public Mail deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { jsonNode = jsonParser.readValueAsTree(); return new Mail( getValue(FROM_ADDRESS, true), getValue(TO_ADDRESS, true), getValue(SUBJECT, false), getValue(MESSAGE, false) ); }
MailDeserializer extends JsonDeserializer<Mail> { @Override public Mail deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { jsonNode = jsonParser.readValueAsTree(); return new Mail( getValue(FROM_ADDRESS, true), getValue(TO_ADDRESS, true), getValue(SUBJECT, false), getValue(MESSAGE, false) ); } }
MailDeserializer extends JsonDeserializer<Mail> { @Override public Mail deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { jsonNode = jsonParser.readValueAsTree(); return new Mail( getValue(FROM_ADDRESS, true), getValue(TO_ADDRESS, true), getValue(SUBJECT, false), getValue(MESSAGE, false) ); }  }
MailDeserializer extends JsonDeserializer<Mail> { @Override public Mail deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { jsonNode = jsonParser.readValueAsTree(); return new Mail( getValue(FROM_ADDRESS, true), getValue(TO_ADDRESS, true), getValue(SUBJECT, false), getValue(MESSAGE, false) ); }  @Override Mail deserialize(JsonParser jsonParser, DeserializationContext ctxt); }
MailDeserializer extends JsonDeserializer<Mail> { @Override public Mail deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { jsonNode = jsonParser.readValueAsTree(); return new Mail( getValue(FROM_ADDRESS, true), getValue(TO_ADDRESS, true), getValue(SUBJECT, false), getValue(MESSAGE, false) ); }  @Override Mail deserialize(JsonParser jsonParser, DeserializationContext ctxt);  }