Add more tests for ResponseEntity handling

Relates to: #5374
This commit is contained in:
Georgios Andrianakis
2019-11-15 14:43:43 +02:00
parent 3d5bbbdada
commit 9629860a8f
2 changed files with 14 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package io.quarkus.it.spring.web;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -39,4 +40,9 @@ public class ExceptionThrowingController {
throw new IllegalArgumentException("hello from error");
}
@GetMapping("/re")
public ResponseEntity<Greeting> responseEntityWithIllegalArgumentException() {
throw new IllegalStateException("hello from error");
}
}

View File

@@ -98,4 +98,12 @@ public class SpringControllerTest {
RestAssured.when().get("/hello").then()
.body(containsString("hello"));
}
@Test
public void testResponseEntityWithIllegalArgumentException() {
RestAssured.when().get("/exception/re").then()
.contentType("application/json")
.body(containsString("hello from error"))
.statusCode(402);
}
}