From 735906c12e780717fd8a35b4ea1947ab9f9d7e9b Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Mon, 16 Oct 2023 17:29:48 +0100 Subject: [PATCH] fix unit tests --- .../client/ValidatorRegistratorTest.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/validator/client/src/test/java/tech/pegasys/teku/validator/client/ValidatorRegistratorTest.java b/validator/client/src/test/java/tech/pegasys/teku/validator/client/ValidatorRegistratorTest.java index 1194339d83e..4e6ebe3f769 100644 --- a/validator/client/src/test/java/tech/pegasys/teku/validator/client/ValidatorRegistratorTest.java +++ b/validator/client/src/test/java/tech/pegasys/teku/validator/client/ValidatorRegistratorTest.java @@ -115,9 +115,8 @@ void setUp(final SpecContext specContext) { .thenAnswer( args -> { final Validator validator = (Validator) args.getArguments()[0]; - return Optional.of( - SafeFuture.completedFuture( - createSignedValidatorRegistration(validator.getPublicKey()))); + return SafeFuture.completedFuture( + createSignedValidatorRegistration(validator.getPublicKey())); }); when(proposerConfigPropertiesProvider.isReadyToProvideProperties()).thenReturn(true); @@ -251,11 +250,10 @@ void registerValidatorsEvenIfOneRegistrationSigningFails() { args -> { final Validator validator = (Validator) args.getArguments()[0]; if (validator.equals(validator2)) { - return Optional.of(SafeFuture.failedFuture(new IllegalStateException("oopsy"))); + return SafeFuture.failedFuture(new IllegalStateException("oopsy")); } - return Optional.of( - SafeFuture.completedFuture( - createSignedValidatorRegistration(validator.getPublicKey()))); + return SafeFuture.completedFuture( + createSignedValidatorRegistration(validator.getPublicKey())); }); runRegistrationFlowWithSubscription(0); @@ -264,9 +262,8 @@ void registerValidatorsEvenIfOneRegistrationSigningFails() { .thenAnswer( args -> { final Validator validator = (Validator) args.getArguments()[0]; - return Optional.of( - SafeFuture.completedFuture( - createSignedValidatorRegistration(validator.getPublicKey()))); + return SafeFuture.completedFuture( + createSignedValidatorRegistration(validator.getPublicKey())); }); runRegistrationFlowWithSubscription(1);