@Test public void unmarshall_InvalidCaseJsonContent_DoesNotUnmarshallCustomFields() throws Exception { CustomException ase = (CustomException) unmarshaller.unmarshall(INVALID_CASE_JSON); assertEquals("Some error message", ase.getErrorMessage()); assertNull(ase.getCustomField()); assertNull(ase.getCustomInt()); }
@Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); }
JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } }
JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String handledErrorCode); }
JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String handledErrorCode); @Override AmazonServiceException unmarshall(JsonNode jsonContent); boolean matchErrorCode(String actualErrorCode); }
JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonNode> { @Override public AmazonServiceException unmarshall(JsonNode jsonContent) throws Exception { return MAPPER.treeToValue(jsonContent, exceptionClass); } JsonErrorUnmarshaller(Class<? extends AmazonServiceException> exceptionClass, String handledErrorCode); @Override AmazonServiceException unmarshall(JsonNode jsonContent); boolean matchErrorCode(String actualErrorCode); static final JsonErrorUnmarshaller DEFAULT_UNMARSHALLER; }