### Question:
ClusterProxyErrorRpcListener implements JsonRpcClient.RequestListener { @Override public void onBeforeResponseProcessed(JsonRpcClient client, ObjectNode response) { throwIfClusterProxyError(response); }  @Override void onBeforeRequestSent(JsonRpcClient client, ObjectNode request); @Override void onBeforeResponseProcessed(JsonRpcClient client, ObjectNode response);  }### Answer:
@Test public void testClusterProxyError() throws IOException { ObjectNode jsonNode = toObjectNode(JSON); assertThrows(ClusterProxyException.class, () -> { clusterProxyErrorRpcListener.onBeforeResponseProcessed(null, jsonNode); }); }
@Test public void testClusterProxyErrorMissingField() throws IOException { ObjectNode jsonNode = toObjectNode(JSON_MISSING_STATUS_FIELD); assertThrows(ClusterProxyException.class, () -> { clusterProxyErrorRpcListener.onBeforeResponseProcessed(null, jsonNode); }); }
@Test public void testClusterProxyErrorNoStatusCode() throws IOException { ObjectNode jsonNode = toObjectNode(JSON_MISSING_CODE_FIELD); clusterProxyErrorRpcListener.onBeforeResponseProcessed(null, jsonNode); }
@Test public void testClusterProxyErroCodeWithoutClusterProxyPrefix() throws IOException { ObjectNode jsonNode = toObjectNode(JSON_CODE_WITHOUT_CLUSTER_PROXY_PREFIX); clusterProxyErrorRpcListener.onBeforeResponseProcessed(null, jsonNode); }