From 78878a6cdd41406d0b950611e88ac15ee5180faf Mon Sep 17 00:00:00 2001 From: Bjørn Christian Seime Date: Mon, 22 Mar 2021 13:53:28 +0100 Subject: Make request content methods result in error response on parse failures --- .../src/test/java/com/yahoo/restapi/RestApiImplTest.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'container-core/src/test/java/com/yahoo/restapi') diff --git a/container-core/src/test/java/com/yahoo/restapi/RestApiImplTest.java b/container-core/src/test/java/com/yahoo/restapi/RestApiImplTest.java index 628c25b23db..16cc2353986 100644 --- a/container-core/src/test/java/com/yahoo/restapi/RestApiImplTest.java +++ b/container-core/src/test/java/com/yahoo/restapi/RestApiImplTest.java @@ -9,8 +9,6 @@ import org.junit.jupiter.api.Test; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.ArrayList; @@ -96,13 +94,7 @@ class RestApiImplTest { void method_handler_can_consume_and_produce_json() { RestApi restApi = RestApi.builder() .addRoute(route("/api").post( - ctx -> { - try { - return ctx.requestContent().get().consumeJacksonEntity(TestEntity.class); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - })) + ctx -> ctx.requestContent().get().consumeJacksonEntity(TestEntity.class))) .build(); String rawJson = "{\"mystring\":\"my-string-value\", \"myinstant\":\"2000-01-01T00:00:00Z\"}"; verifyJsonResponse(restApi, Method.POST, "/api", rawJson, 200, rawJson); -- cgit v1.2.3