From 49da37ee53be7221ea53ef4b15f1093ee02ec252 Mon Sep 17 00:00:00 2001 From: courtneyeh Date: Mon, 15 Apr 2024 13:33:59 +1000 Subject: [PATCH] Small changes --- .../validator/client/restapi/apis/GetGraffiti.java | 4 ++-- .../client/restapi/apis/GetGraffitiTest.java | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffiti.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffiti.java index 94900c8da13..05b008cdcc9 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffiti.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/restapi/apis/GetGraffiti.java @@ -63,7 +63,6 @@ public GetGraffiti(final KeyManager keyManager) { .response(SC_OK, "Success response", RESPONSE_TYPE) .withAuthenticationResponses() .withNotFoundResponse() - .withNotImplementedResponse() .build()); this.keyManager = keyManager; } @@ -78,7 +77,8 @@ public void handleRequest(RestApiRequest request) throws JsonProcessingException return; } - String graffiti = maybeValidator.get().getGraffiti().map(this::processGraffitiBytes).orElse(""); + final String graffiti = + maybeValidator.get().getGraffiti().map(this::processGraffitiBytes).orElse(""); request.respondOk(new GraffitiResponse(publicKey, graffiti)); } 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 3e5f4bda765..71b495ecad8 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 @@ -22,7 +22,6 @@ import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_FORBIDDEN; import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_INTERNAL_SERVER_ERROR; import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_NOT_FOUND; -import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_NOT_IMPLEMENTED; import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_OK; import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_UNAUTHORIZED; import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.getResponseStringFromMetadata; @@ -69,7 +68,7 @@ void shouldGetGraffiti() throws JsonProcessingException { handler.handleRequest(request); - GetGraffiti.GraffitiResponse expectedResponse = + final GetGraffiti.GraffitiResponse expectedResponse = new GetGraffiti.GraffitiResponse(publicKey, stringGraffiti); assertThat(request.getResponseCode()).isEqualTo(SC_OK); assertThat(request.getResponseBody()).isEqualTo(expectedResponse); @@ -89,7 +88,8 @@ void shouldGetEmptyGraffiti() throws JsonProcessingException { handler.handleRequest(request); - GetGraffiti.GraffitiResponse expectedResponse = new GetGraffiti.GraffitiResponse(publicKey, ""); + final GetGraffiti.GraffitiResponse expectedResponse = + new GetGraffiti.GraffitiResponse(publicKey, ""); assertThat(request.getResponseCode()).isEqualTo(SC_OK); assertThat(request.getResponseBody()).isEqualTo(expectedResponse); } @@ -141,9 +141,4 @@ void metadata_shouldHandle403() throws JsonProcessingException { void metadata_shouldHandle500() throws JsonProcessingException { verifyMetadataErrorResponse(handler, SC_INTERNAL_SERVER_ERROR); } - - @Test - void metadata_shouldHandle501() throws JsonProcessingException { - verifyMetadataErrorResponse(handler, SC_NOT_IMPLEMENTED); - } }