Consistent throwing of HttpMessageNotReadableException vs IOException
Includes specific fine-tuning of ProtobufHttpMessageConverter and JAXB2 based message converters, as well as revised javadoc for abstract base classes. Issue: SPR-16995
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -95,7 +95,7 @@ public class ResourceHttpMessageConverterTests {
|
||||
public void shouldNotReadInputStreamResource() throws IOException {
|
||||
ResourceHttpMessageConverter noStreamConverter = new ResourceHttpMessageConverter(false);
|
||||
try (InputStream body = getClass().getResourceAsStream("logo.jpg") ) {
|
||||
this.thrown.expect(IllegalStateException.class);
|
||||
this.thrown.expect(HttpMessageNotReadableException.class);
|
||||
MockHttpInputMessage inputMessage = new MockHttpInputMessage(body);
|
||||
inputMessage.getHeaders().setContentType(MediaType.IMAGE_JPEG);
|
||||
noStreamConverter.read(InputStreamResource.class, inputMessage);
|
||||
|
||||
Reference in New Issue
Block a user