Skip to content

Commit

Permalink
Use NoOpSigner instead of mock
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyeh committed Apr 15, 2024
1 parent 743a836 commit a1f48ab
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit a1f48ab

Please sign in to comment.