Java Code Examples for org.springframework.mock.http.MockHttpOutputMessage#getBodyAsString()
The following examples show how to use
org.springframework.mock.http.MockHttpOutputMessage#getBodyAsString() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractSpringMVCTest.java From SMSC with Apache License 2.0 | 5 votes |
protected String json(Object o) throws IOException { MockHttpOutputMessage mockHttpOutputMessage = new MockHttpOutputMessage(); this.mappingJackson2HttpMessageConverter.write( o, MediaType.APPLICATION_JSON, mockHttpOutputMessage); return mockHttpOutputMessage.getBodyAsString(); }
Example 2
Source File: TestSupport.java From exchange-gateway-rest with Apache License 2.0 | 4 votes |
protected String json(Object object) throws IOException { MockHttpOutputMessage mockHttpOutputMessage = new MockHttpOutputMessage(); //noinspection unchecked mappingJackson2HttpMessageConverter.write(object, MediaType.APPLICATION_JSON, mockHttpOutputMessage); return mockHttpOutputMessage.getBodyAsString(); }
Example 3
Source File: TestDataGenerator.java From springrestdoc with MIT License | 4 votes |
@SneakyThrows public String asJsonString(Object o) { MockHttpOutputMessage mockHttpOutputMessage = new MockHttpOutputMessage(); messageConverter.write(o, MediaType.APPLICATION_JSON, mockHttpOutputMessage); return mockHttpOutputMessage.getBodyAsString(); }
Example 4
Source File: TestDataGenerator.java From springrestdoc with MIT License | 4 votes |
@SneakyThrows public String asJsonString(Object o) { MockHttpOutputMessage mockHttpOutputMessage = new MockHttpOutputMessage(); messageConverter.write(o, MediaType.APPLICATION_JSON, mockHttpOutputMessage); return mockHttpOutputMessage.getBodyAsString(); }
Example 5
Source File: SprintBootWebApplicationTests.java From pro-spring-boot with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") protected String toJsonString(Object obj) throws IOException { MockHttpOutputMessage mockHttpOutputMessage = new MockHttpOutputMessage(); this.mappingJackson2HttpMessageConverter.write(obj, MediaType.APPLICATION_JSON, mockHttpOutputMessage); return mockHttpOutputMessage.getBodyAsString(); }
Example 6
Source File: Util.java From fiware-cepheus with GNU General Public License v2.0 | 4 votes |
static public String json(MappingJackson2HttpMessageConverter mapping, Object o) throws IOException { MockHttpOutputMessage mockHttpOutputMessage = new MockHttpOutputMessage(); mapping.write(o, MediaType.APPLICATION_JSON, mockHttpOutputMessage); return mockHttpOutputMessage.getBodyAsString(); }
Example 7
Source File: Util.java From fiware-cepheus with GNU General Public License v2.0 | 4 votes |
static public String json(MappingJackson2HttpMessageConverter mapping, Object o) throws IOException { MockHttpOutputMessage mockHttpOutputMessage = new MockHttpOutputMessage(); mapping.write(o, MediaType.APPLICATION_JSON, mockHttpOutputMessage); return mockHttpOutputMessage.getBodyAsString(); }
Example 8
Source File: SprintBootWebApplicationTests.java From pro-spring-boot with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") protected String toJsonString(Object obj) throws IOException { MockHttpOutputMessage mockHttpOutputMessage = new MockHttpOutputMessage(); this.mappingJackson2HttpMessageConverter.write(obj, MediaType.APPLICATION_JSON, mockHttpOutputMessage); return mockHttpOutputMessage.getBodyAsString(); }