forked from Consensys/teku
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c76deb3
commit 29fdddb
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
...ent/src/test/java/tech/pegasys/teku/validator/client/restapi/apis/DeleteGraffitiTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright Consensys Software Inc., 2024 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package tech.pegasys.teku.validator.client.restapi.apis; | ||
|
||
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_BAD_REQUEST; | ||
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_IMPLEMENTED; | ||
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_NO_CONTENT; | ||
import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_UNAUTHORIZED; | ||
import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.verifyMetadataEmptyResponse; | ||
import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.verifyMetadataErrorResponse; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class DeleteGraffitiTest { | ||
private final DeleteGraffiti handler = new DeleteGraffiti(); | ||
|
||
@Test | ||
void metadata_shouldHandle204() { | ||
verifyMetadataEmptyResponse(handler, SC_NO_CONTENT); | ||
} | ||
|
||
@Test | ||
void metadata_shouldHandle400() throws JsonProcessingException { | ||
verifyMetadataErrorResponse(handler, SC_BAD_REQUEST); | ||
} | ||
|
||
@Test | ||
void metadata_shouldHandle401() throws JsonProcessingException { | ||
verifyMetadataErrorResponse(handler, SC_UNAUTHORIZED); | ||
} | ||
|
||
@Test | ||
void metadata_shouldHandle403() throws JsonProcessingException { | ||
verifyMetadataErrorResponse(handler, SC_FORBIDDEN); | ||
} | ||
|
||
@Test | ||
void metadata_shouldHandle500() throws JsonProcessingException { | ||
verifyMetadataErrorResponse(handler, SC_INTERNAL_SERVER_ERROR); | ||
} | ||
|
||
@Test | ||
void metadata_shouldHandle501() throws JsonProcessingException { | ||
verifyMetadataErrorResponse(handler, SC_NOT_IMPLEMENTED); | ||
} | ||
} |