org.springframework.mock.http.MockHttpInputMessage Java Examples

The following examples show how to use org.springframework.mock.http.MockHttpInputMessage. 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: SimulatorHttpMessageConverterTest.java    From citrus-simulator with Apache License 2.0 5 votes vote down vote up
@Test
public void testSimulatorMessageConverter() throws IOException {
    Assert.assertFalse(converter.canRead(Object.class, Object.class, MediaType.ALL));
    Assert.assertFalse(converter.canRead(Object.class, MediaType.ALL));
    Assert.assertFalse(converter.canWrite(Object.class, Object.class, MediaType.ALL));
    Assert.assertFalse(converter.canWrite(Object.class, MediaType.ALL));

    Assert.assertEquals(converter.read(String.class, HttpMessageController.class, new MockHttpInputMessage("Hello".getBytes(Charset.forName("UTF-8")))), "Hello");
}
 
Example #2
Source File: FilterConverterITest.java    From jfilter with Apache License 2.0 4 votes vote down vote up
@Test
public void testRead() throws IOException {
    FilterClassWrapper wrapper = (FilterClassWrapper) filterConverter.read(null, new MockHttpInputMessage("test".getBytes()));
    assertNull(wrapper);
}
 
Example #3
Source File: SimulatorHttpMessageConverterTest.java    From citrus-simulator with Apache License 2.0 4 votes vote down vote up
@Test(expectedExceptions = IllegalStateException.class)
public void testUnsupportedRead() throws IOException {
    converter.read(Object.class, new MockHttpInputMessage("Hello".getBytes(Charset.forName("UTF-8"))));
}