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