### Question:
EthGetBlockByHash implements JsonRpcMethod { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { return new JsonRpcSuccessResponse( requestContext.getRequest().getId(), blockResult(requestContext)); } EthGetBlockByHash(
      final BlockchainQueries blockchain, final BlockResultFactory blockResult);  EthGetBlockByHash(
      final Supplier<BlockchainQueries> blockchain,
      final BlockResultFactory blockResult,
      final boolean includeCoinbase); @Override String getName(); @Override JsonRpcResponse response(final JsonRpcRequestContext requestContext);  }### Answer:
@Test public void exceptionWhenNoParamsSupplied() { final JsonRpcRequestContext request = requestWithParams(); thrown.expect(InvalidJsonRpcParameters.class); thrown.expectMessage("Missing required json rpc parameter at index 0"); method.response(request); verifyNoMoreInteractions(blockchainQueries); }
@Test public void exceptionWhenNoHashSupplied() { final JsonRpcRequestContext request = requestWithParams("false"); thrown.expect(InvalidJsonRpcParameters.class); thrown.expectMessage("Invalid json rpc parameter at index 0"); method.response(request); verifyNoMoreInteractions(blockchainQueries); }
@Test public void exceptionWhenNoBoolSupplied() { final JsonRpcRequestContext request = requestWithParams(ZERO_HASH); thrown.expect(InvalidJsonRpcParameters.class); thrown.expectMessage("Missing required json rpc parameter at index 1"); method.response(request); verifyNoMoreInteractions(blockchainQueries); }
@Test public void exceptionWhenHashParamInvalid() { final JsonRpcRequestContext request = requestWithParams("hash", "true"); thrown.expect(InvalidJsonRpcParameters.class); thrown.expectMessage("Invalid json rpc parameter at index 0"); method.response(request); verifyNoMoreInteractions(blockchainQueries); }
@Test public void exceptionWhenBoolParamInvalid() { final JsonRpcRequestContext request = requestWithParams(ZERO_HASH, "maybe"); thrown.expect(InvalidJsonRpcParameters.class); thrown.expectMessage("Invalid json rpc parameter at index 1"); method.response(request); verifyNoMoreInteractions(blockchainQueries); }