Closed GoogleCodeExporter closed 8 years ago
And the test:
Index: jsonrpc4j/src/test/java/com/googlecode/jsonrpc4j/JsonRpcServerTest.java
===================================================================
--- jsonrpc4j/src/test/java/com/googlecode/jsonrpc4j/JsonRpcServerTest.java
(revision 238683)
+++ jsonrpc4j/src/test/java/com/googlecode/jsonrpc4j/JsonRpcServerTest.java
(working copy)
@@ -1,6 +1,7 @@
package com.googlecode.jsonrpc4j;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
@@ -382,7 +383,17 @@
assertTrue(json.get("id").isNull());
}
+ @Test
+ public void callParseErrorJson() throws Exception {
+ jsonRpcServerAnnotatedParam.handle(new
ClassPathResource("jsonRpcParseErrorTest.json").getInputStream(), baos);
+ String response = baos.toString(JSON_ENCODING);
+ JsonNode json = mapper.readTree(response);
+
+ // Invalid parameters
+ assertEquals(-32700, json.get("error").get("code").asInt());
+ }
+
// Service and service interfaces used in test
private interface ServiceInterface {
Original comment by smend...@gmail.com
on 13 Feb 2013 at 7:32
thanks, applied the patch
Original comment by brian.di...@gmail.com
on 16 Feb 2013 at 8:09
Original issue reported on code.google.com by
smend...@gmail.com
on 13 Feb 2013 at 7:29