Fix /prefix test so it asserts a 404 as well as a 200

This commit is contained in:
Dave Syer
2017-06-28 09:41:04 +01:00
parent b9eb46c7bd
commit e4b181d0c4
2 changed files with 13 additions and 2 deletions

View File

@@ -53,12 +53,19 @@ public class PrefixTests {
@Test
public void words() throws Exception {
ResponseEntity<String> result = rest
.exchange(RequestEntity.get(new URI("/functions/words")).build(), String.class);
ResponseEntity<String> result = rest.exchange(
RequestEntity.get(new URI("/functions/words")).build(), String.class);
assertThat(result.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(result.getBody()).isEqualTo("[\"foo\",\"bar\"]");
}
@Test
public void missing() throws Exception {
ResponseEntity<String> result = rest
.exchange(RequestEntity.get(new URI("/words")).build(), String.class);
assertThat(result.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}
@EnableAutoConfiguration
@org.springframework.boot.test.context.TestConfiguration
protected static class TestConfiguration {