### Question:
IbftDiscardValidatorVote implements JsonRpcMethod { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { final Address validatorAddress = requestContext.getRequiredParameter(0, Address.class); LOG.trace("Received RPC rpcName={} address={}", getName(), validatorAddress); voteProposer.discard(validatorAddress); return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), true); } IbftDiscardValidatorVote(final VoteProposer voteProposer); @Override String getName(); @Override JsonRpcResponse response(final JsonRpcRequestContext requestContext);  }### Answer:
@Test public void exceptionWhenNoParamsSupplied() { final JsonRpcRequestContext request = requestWithParams(); expectedException.expect(InvalidJsonRpcParameters.class); expectedException.expectMessage("Missing required json rpc parameter at index 0"); method.response(request); }
@Test public void exceptionWhenInvalidAddressParameterSupplied() { final JsonRpcRequestContext request = requestWithParams("InvalidAddress"); expectedException.expect(InvalidJsonRpcParameters.class); expectedException.expectMessage("Invalid json rpc parameter at index 0"); method.response(request); }
@Test public void discardValidator() { final Address parameterAddress = Address.fromHexString("1"); final JsonRpcRequestContext request = requestWithParams(parameterAddress); final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(request.getRequest().getId(), true); final JsonRpcResponse response = method.response(request); assertThat(response).isEqualToComparingFieldByField(expectedResponse); verify(voteProposer).discard(parameterAddress); }