Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tbenr committed Oct 16, 2024
1 parent fae094d commit a90530e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ public void shouldReturnServerErrorWhenUnexpectedErrorHappens() throws Exception
final Response response =
post(
PostAttesterSlashing.ROUTE,
JsonUtil.serialize(
slashing,
slashing.getSchema().castTypeToAttesterSlashingSchema().getJsonTypeDefinition()));
JsonUtil.serialize(slashing, slashing.getSchema().getJsonTypeDefinition()));
assertThat(response.code()).isEqualTo(SC_INTERNAL_SERVER_ERROR);
}

Expand All @@ -78,9 +76,7 @@ public void shouldReturnSuccessWhenRequestBodyIsValid() throws Exception {
final Response response =
post(
PostAttesterSlashing.ROUTE,
JsonUtil.serialize(
slashing,
slashing.getSchema().castTypeToAttesterSlashingSchema().getJsonTypeDefinition()));
JsonUtil.serialize(slashing, slashing.getSchema().getJsonTypeDefinition()));

verify(attesterSlashingPool).addLocal(slashing);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ public void shouldReturnServerErrorWhenUnexpectedErrorHappens() throws Exception
final Response response =
post(
PostAttesterSlashingV2.ROUTE,
JsonUtil.serialize(
slashing,
slashing.getSchema().castTypeToAttesterSlashingSchema().getJsonTypeDefinition()),
JsonUtil.serialize(slashing, slashing.getSchema().getJsonTypeDefinition()),
Collections.emptyMap(),
Optional.of(specMilestone.name().toLowerCase(Locale.ROOT)));
assertThat(response.code()).isEqualTo(500);
Expand All @@ -99,9 +97,7 @@ public void shouldReturnSuccessWhenRequestBodyIsValid() throws Exception {
final Response response =
post(
PostAttesterSlashingV2.ROUTE,
JsonUtil.serialize(
slashing,
slashing.getSchema().castTypeToAttesterSlashingSchema().getJsonTypeDefinition()),
JsonUtil.serialize(slashing, slashing.getSchema().getJsonTypeDefinition()),
Collections.emptyMap(),
Optional.of(specMilestone.name().toLowerCase(Locale.ROOT)));

Expand All @@ -117,9 +113,7 @@ void shouldFailWhenMissingConsensusHeader() throws Exception {
final Response response =
post(
PostAttesterSlashingV2.ROUTE,
JsonUtil.serialize(
slashing,
slashing.getSchema().castTypeToAttesterSlashingSchema().getJsonTypeDefinition()));
JsonUtil.serialize(slashing, slashing.getSchema().getJsonTypeDefinition()));

assertThat(response.code()).isEqualTo(SC_BAD_REQUEST);

Expand All @@ -139,9 +133,7 @@ void shouldFailWhenBadConsensusHeaderValue() throws Exception {
final Response response =
post(
PostAttesterSlashingV2.ROUTE,
JsonUtil.serialize(
slashing,
slashing.getSchema().castTypeToAttesterSlashingSchema().getJsonTypeDefinition()),
JsonUtil.serialize(slashing, slashing.getSchema().getJsonTypeDefinition()),
Collections.emptyMap(),
Optional.of(badConsensusHeaderValue));

Expand Down

0 comments on commit a90530e

Please sign in to comment.