Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyeh committed Apr 15, 2024
1 parent dc47d80 commit 49da37e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public GetGraffiti(final KeyManager keyManager) {
.response(SC_OK, "Success response", RESPONSE_TYPE)
.withAuthenticationResponses()
.withNotFoundResponse()
.withNotImplementedResponse()
.build());
this.keyManager = keyManager;
}
Expand All @@ -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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 49da37e

Please sign in to comment.