### Question:
IbftProposeValidatorVote implements JsonRpcMethod { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { final Address validatorAddress = requestContext.getRequiredParameter(0, Address.class); final Boolean add = requestContext.getRequiredParameter(1, Boolean.class); LOG.trace( "Received RPC rpcName={} voteType={} address={}", getName(), add ? VoteType.ADD : VoteType.DROP, validatorAddress); if (add) { voteProposer.auth(validatorAddress); } else { voteProposer.drop(validatorAddress); } return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), true); } IbftProposeValidatorVote(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 exceptionWhenNoAuthSupplied() { final JsonRpcRequestContext request = requestWithParams(Address.fromHexString("1")); expectedException.expect(InvalidJsonRpcParameters.class); expectedException.expectMessage("Missing required json rpc parameter at index 1"); method.response(request); }
@Test public void exceptionWhenNoAddressSupplied() { final JsonRpcRequestContext request = requestWithParams("true"); expectedException.expect(InvalidJsonRpcParameters.class); expectedException.expectMessage("Invalid json rpc parameter at index 0"); method.response(request); }
@Test public void exceptionWhenInvalidBoolParameterSupplied() { final JsonRpcRequestContext request = requestWithParams(Address.fromHexString("1"), "c"); expectedException.expect(InvalidJsonRpcParameters.class); expectedException.expectMessage("Invalid json rpc parameter at index 1"); method.response(request); }
@Test public void addValidator() { final Address parameterAddress = Address.fromHexString("1"); final JsonRpcRequestContext request = requestWithParams(parameterAddress, "true"); final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(request.getRequest().getId(), true); final JsonRpcResponse response = method.response(request); assertThat(response).isEqualToComparingFieldByField(expectedResponse); verify(voteProposer).auth(parameterAddress); }
@Test public void removeValidator() { final Address parameterAddress = Address.fromHexString("1"); final JsonRpcRequestContext request = requestWithParams(parameterAddress, "false"); final JsonRpcResponse expectedResponse = new JsonRpcSuccessResponse(request.getRequest().getId(), true); final JsonRpcResponse response = method.response(request); assertThat(response).isEqualToComparingFieldByField(expectedResponse); verify(voteProposer).drop(parameterAddress); }