Skip to content

Commit

Permalink
fix testcase
Browse files Browse the repository at this point in the history
Signed-off-by: Iryoung Jeong <[email protected]>
  • Loading branch information
iryoung committed Jan 20, 2025
1 parent 702ce74 commit 36eb5bf
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,17 @@ public void returnsCorrectMethodName() {
@Test
public void exceptionWhenNoParamsSupplied() {
assertThatThrownBy(() -> method.response(requestWithParams()))
.isInstanceOf(InvalidJsonRpcParameters.class);
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasFieldOrPropertyWithValue("rpcErrorType", RpcErrorType.INVALID_BLOCK_NUMBER_PARAMS);
verifyNoMoreInteractions(blockchainQueries);
}

@Test
public void exceptionWhenNoNumberSupplied() {
assertThatThrownBy(() -> method.response(requestWithParams("false")))
.isInstanceOf(InvalidJsonRpcParameters.class);
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasFieldOrPropertyWithValue("rpcErrorType", RpcErrorType.INVALID_BLOCK_NUMBER_PARAMS);

verifyNoMoreInteractions(blockchainQueries);
}

Expand All @@ -129,7 +132,8 @@ public void exceptionWhenNoBoolSupplied() {
public void exceptionWhenNumberParamInvalid() {
assertThatThrownBy(() -> method.response(requestWithParams("invalid", "true")))
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasMessage("Invalid block parameter (index 0)");
.hasMessage("Invalid block parameter (index 0)")
.hasFieldOrPropertyWithValue("rpcErrorType", RpcErrorType.INVALID_BLOCK_NUMBER_PARAMS);
verifyNoMoreInteractions(blockchainQueries);
}

Expand Down

0 comments on commit 36eb5bf

Please sign in to comment.