Tweak support for single valued text HTTP exchange

This commit is contained in:
Dave Syer
2018-05-02 13:00:22 -04:00
parent fa55ebab16
commit af5f5b78de
2 changed files with 9 additions and 0 deletions

View File

@@ -338,6 +338,14 @@ public class RestApplicationTests {
assertThat(result.getBody()).isEqualTo("[\"(FOO)\",\"(BAR)\"]");
}
@Test
public void singleValuedText() throws Exception {
ResponseEntity<String> result = rest.exchange(RequestEntity
.post(new URI("/bareUppercase")).contentType(MediaType.TEXT_PLAIN)
.body("foo"), String.class);
assertThat(result.getBody()).isEqualTo("(FOO)");
}
@Test
public void transform() throws Exception {
ResponseEntity<String> result = rest.exchange(RequestEntity