We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
my JsonRpcService method param is List,this exception occurs when I execute unit tests, how does jackson set up?
I use the parameters in the postman request interface and there is no problem
curl --location --request POST 'http://localhost:8080/rpc/user' \ --header 'Content-Type: application/json' \ --data '{"method":"testUser","id":"0","jsonrpc":"2.0","params":[[{"id":94540,"code":"1"}]]}'
this is my interface
@JsonRpcService(value = "rpc/user") public interface UserService { List<UserDTO>> testUser(List<User> userList); }
test case
@Resource private UserRpcService userRpcService; ObjectMapper objectMapper = new ObjectMapper(); JsonRpcServer jsonRpcServer = new JsonRpcServer(objectMapper,userRpcService); User user = new User(); user.setId(1); user.setCode("1") List<User> userList = new ArrayList<>(); userList.add(user); List<List<User>> list = new ArrayList<>(); list.add(userList); Map<String,Object> map = new HashMap(); map.put("method","testUser"); map.put("jsonrpc","2.0"); map.put("id","1"); map.put("params",list); MockHttpServletRequest request = new MockHttpServletRequest("POST", "rpc/user"); request.setContentType(MediaType.APPLICATION_JSON_VALUE); request.setCharacterEncoding(StandardCharsets.UTF_8.name()); MockHttpServletResponse response = new MockHttpServletResponse(); request.setContent(map.toString.getBytes(StandardCharsets.UTF_8)); jsonRpcServer.handle(request, response); response.setCharacterEncoding(StandardCharsets.UTF_8.name());
jsonrpc4j version: 2.2.4-alpha
The text was updated successfully, but these errors were encountered:
No branches or pull requests
my JsonRpcService method param is List,this exception occurs when I execute unit tests, how does jackson set up?
I use the parameters in the postman request interface and there is no problem
this is my interface
test case
jsonrpc4j version: 2.2.4-alpha
The text was updated successfully, but these errors were encountered: