diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/PostStateValidatorBalancesTest.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/PostStateValidatorBalancesTest.java index db2af82c5c9..b33c2192432 100644 --- a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/PostStateValidatorBalancesTest.java +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/PostStateValidatorBalancesTest.java @@ -27,7 +27,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import java.util.Optional; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import tech.pegasys.teku.api.migrated.StateValidatorBalanceData; @@ -57,13 +56,13 @@ public void shouldGetSpecifiedValidatorBalancesFromState() throws Exception { .build(); request.setRequestBody(List.of("1", "2")); - final Optional>> expectedData = - chainDataProvider.getStateValidatorBalances("head", List.of("1", "2")).get(); + final ObjectAndMetaData> expectedData = + chainDataProvider.getStateValidatorBalances("head", List.of("1", "2")).get().orElseThrow(); handler.handleRequest(request); assertThat(request.getResponseCode()).isEqualTo(SC_OK); - assertThat(request.getResponseBody()).isEqualTo(expectedData.orElseThrow()); + assertThat(request.getResponseBody()).isEqualTo(expectedData); } @Test @@ -74,13 +73,13 @@ public void shouldGetAllValidatorBalancesFromState() throws Exception { .pathParameter("state_id", "head") .build(); - final Optional>> expectedData = - chainDataProvider.getStateValidatorBalances("head", List.of()).get(); + final ObjectAndMetaData> expectedData = + chainDataProvider.getStateValidatorBalances("head", List.of()).get().orElseThrow(); handler.handleRequest(request); assertThat(request.getResponseCode()).isEqualTo(SC_OK); - assertThat(request.getResponseBody()).isEqualTo(expectedData.orElseThrow()); + assertThat(request.getResponseBody()).isEqualTo(expectedData); } @Test