mirror of
https://github.com/jlengrand/quarkus.git
synced 2026-03-10 08:41:22 +00:00
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user