{"action":"opened","issue":{"url":"https://api.github.com/repos/rest-assured/rest-assured/issues/780","repository_url":"https://api.github.com/repos/rest-assured/rest-assured","labels_url":"https://api.github.com/repos/rest-assured/rest-assured/issues/780/labels{/name}","comments_url":"https://api.github.com/repos/rest-assured/rest-assured/issues/780/comments","events_url":"https://api.github.com/repos/rest-assured/rest-assured/issues/780/events","html_url":"https://github.com/rest-assured/rest-assured/issues/780","id":196605877,"number":780,"title":"given().sessionAttrs() will serial param object,which will lead to java.lang.ClassCastException","user":{"login":"rbsrcy","id":4798540,"avatar_url":"https://avatars.githubusercontent.com/u/4798540?v=3","gravatar_id":"","url":"https://api.github.com/users/rbsrcy","html_url":"https://github.com/rbsrcy","followers_url":"https://api.github.com/users/rbsrcy/followers","following_url":"https://api.github.com/users/rbsrcy/following{/other_user}","gists_url":"https://api.github.com/users/rbsrcy/gists{/gist_id}","starred_url":"https://api.github.com/users/rbsrcy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbsrcy/subscriptions","organizations_url":"https://api.github.com/users/rbsrcy/orgs","repos_url":"https://api.github.com/users/rbsrcy/repos","events_url":"https://api.github.com/users/rbsrcy/events{/privacy}","received_events_url":"https://api.github.com/users/rbsrcy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-20T07:39:47Z","updated_at":"2016-12-20T07:39:47Z","closed_at":null,"body":"my code as below:\r\n\r\n        CustOptr custOptr = new CustOptr();\r\n        custOptr.setCustId(1L);\r\n        custOptr.setOptrCode(\"test1\");\r\n\r\n        HashMap<String, Object> sa = new HashMap<>();\r\n        sa.put(SessionContainer.CUST_OPTR,custOptr);\r\n        RestAssured.defaultParser = Parser.JSON;\r\n        RestAssured.registerParser(\"null\", Parser.JSON);\r\n        given().contentType(\"application/json\").\r\n                sessionId(\"1\").\r\n                sessionAttrs(sa).\r\n        when().\r\n                post(\"/account/getAccountInfo.ajax\").\r\n        then().\r\n                statusCode(HttpServletResponse.SC_OK).apply(print());`\r\n\r\n\r\nthe result as below\r\n\r\nMockHttpServletRequest:\r\n         HTTP Method = POST\r\n         Request URI = /account/getAccountInfo.ajax\r\n          Parameters = {}\r\n             Headers = {Content-Type=[application/json]}\r\n\r\n             Handler:\r\n                Type = com.h2finance.miniportal.controller.AccountController\r\n              Method = public java.util.Map<java.lang.String, java.lang.Object> com.h2finance.miniportal.controller.AccountController.getAccountInfo(javax.servlet.http.HttpSession)\r\n\r\n               Async:\r\n   Was async started = false\r\n        Async result = null\r\n\r\n  Resolved Exception:\r\n                Type = java.lang.ClassCastException\r\n\r\n        ModelAndView:\r\n           View name = error\r\n                View = null\r\n           Attribute = exception\r\n               value = java.lang.ClassCastException: java.lang.String cannot be cast to com.h2finance.core.entity.cust.CustOptr\r\n\r\n            FlashMap:\r\n\r\nMockHttpServletResponse:\r\n              Status = 200\r\n       Error message = null\r\n             Headers = {}\r\n        Content type = null\r\n                Body = \r\n       Forwarded URL = /WEB-INF/jsp/error.jsp\r\n      Redirected URL = null\r\n             Cookies = []\r\n\r\n\r\nwhen i follow the code, i found out the code below change my session attrabute class type\r\n\r\nio.restassured.internal.support.ParameterUpdater line 83 \r\n\r\ndef newValue = serializer.serializeIfNeeded(value)\r\n\r\nps:my rest-assured version is 3.0.1 spring version is 4.1.2-RELEASE"}}
{"actor":{"display_login":"rbsrcy"}}