From a1f48abbd951e57ccf0242fcda8ecf75b566604b Mon Sep 17 00:00:00 2001 From: courtneyeh Date: Mon, 15 Apr 2024 14:27:58 +1000 Subject: [PATCH] Use NoOpSigner instead of mock --- .../validator/client/restapi/apis/GetGraffitiTest.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/validator/client/src/test/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffitiTest.java b/validator/client/src/test/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffitiTest.java index 71b495ecad8..436bf18c29a 100644 --- a/validator/client/src/test/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffitiTest.java +++ b/validator/client/src/test/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffitiTest.java @@ -26,6 +26,7 @@ import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_UNAUTHORIZED; import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.getResponseStringFromMetadata; import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.verifyMetadataErrorResponse; +import static tech.pegasys.teku.spec.generator.signatures.NoOpLocalSigner.NO_OP_SIGNER; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; @@ -36,7 +37,6 @@ import tech.pegasys.teku.infrastructure.http.HttpErrorResponse; import tech.pegasys.teku.infrastructure.restapi.StubRestApiRequest; import tech.pegasys.teku.spec.TestSpecFactory; -import tech.pegasys.teku.spec.signatures.Signer; import tech.pegasys.teku.spec.util.DataStructureUtil; import tech.pegasys.teku.validator.api.Bytes32Parser; import tech.pegasys.teku.validator.client.OwnedKeyManager; @@ -62,8 +62,7 @@ void shouldGetGraffiti() throws JsonProcessingException { .pathParameter("pubkey", publicKey.toHexString()) .build(); - final Validator validator = - new Validator(publicKey, mock(Signer.class), () -> Optional.of(graffiti)); + final Validator validator = new Validator(publicKey, NO_OP_SIGNER, () -> Optional.of(graffiti)); when(keyManager.getValidatorByPublicKey(eq(publicKey))).thenReturn(Optional.of(validator)); handler.handleRequest(request); @@ -83,7 +82,7 @@ void shouldGetEmptyGraffiti() throws JsonProcessingException { .pathParameter("pubkey", publicKey.toHexString()) .build(); - final Validator validator = new Validator(publicKey, mock(Signer.class), Optional::empty); + final Validator validator = new Validator(publicKey, NO_OP_SIGNER, Optional::empty); when(keyManager.getValidatorByPublicKey(eq(publicKey))).thenReturn(Optional.of(validator)); handler.handleRequest(request);