From 93177af38ca6cc44e91b6f383346e6b1659d8af0 Mon Sep 17 00:00:00 2001 From: Courtney <45641759+courtneyeh@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:39:52 +1300 Subject: [PATCH] Remove bug from getOptionalRequest method (#7730) --- .../teku/infrastructure/restapi/StubRestApiRequest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/infrastructure/restapi/src/testFixtures/java/tech/pegasys/teku/infrastructure/restapi/StubRestApiRequest.java b/infrastructure/restapi/src/testFixtures/java/tech/pegasys/teku/infrastructure/restapi/StubRestApiRequest.java index 4eb2ceb86f3..6b2e80da1e3 100644 --- a/infrastructure/restapi/src/testFixtures/java/tech/pegasys/teku/infrastructure/restapi/StubRestApiRequest.java +++ b/infrastructure/restapi/src/testFixtures/java/tech/pegasys/teku/infrastructure/restapi/StubRestApiRequest.java @@ -89,9 +89,8 @@ public T getRequestBody() { } @Override - @SuppressWarnings({"unchecked", "TypeParameterUnusedInFormals"}) public Optional getOptionalRequestBody() throws JsonProcessingException { - return Optional.of((T) requestBody); + return Optional.ofNullable(getRequestBody()); } @Override