{"action":"opened","issue":{"url":"https://api.github.com/repos/mockrunner/mockrunner/issues/55","repository_url":"https://api.github.com/repos/mockrunner/mockrunner","labels_url":"https://api.github.com/repos/mockrunner/mockrunner/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/mockrunner/mockrunner/issues/55/comments","events_url":"https://api.github.com/repos/mockrunner/mockrunner/issues/55/events","html_url":"https://github.com/mockrunner/mockrunner/issues/55","id":252526123,"number":55,"title":"Working with sessions from MockHttpServletRequest","user":{"login":"mthmulders","id":430114,"avatar_url":"https://avatars1.githubusercontent.com/u/430114?v=4","gravatar_id":"","url":"https://api.github.com/users/mthmulders","html_url":"https://github.com/mthmulders","followers_url":"https://api.github.com/users/mthmulders/followers","following_url":"https://api.github.com/users/mthmulders/following{/other_user}","gists_url":"https://api.github.com/users/mthmulders/gists{/gist_id}","starred_url":"https://api.github.com/users/mthmulders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mthmulders/subscriptions","organizations_url":"https://api.github.com/users/mthmulders/orgs","repos_url":"https://api.github.com/users/mthmulders/repos","events_url":"https://api.github.com/users/mthmulders/events{/privacy}","received_events_url":"https://api.github.com/users/mthmulders/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-24T08:32:59Z","updated_at":"2017-08-24T08:32:59Z","closed_at":null,"body":"As I was writing some tests involving `HttpServlet` and `HttpSession`, I noticed the following:\r\n1. When you invoke `MockHttpServletRequest#getSession(false)` after having set a `MockHttpSession`, it will still return `null`.\r\n1. When you invoke `MockHttpServletRequest#getSession(true)` (without further interaction with that `HttpServletRequest`) it will return `null`.\r\n\r\nI would like to suggest the following changes:\r\n1. When you invoke `MockHttpServletRequest#getSession(false)` after having set a `MockHttpSession`, it will return the previously set `MockHttpSession`.\r\n1. When you invoke `MockHttpServletRequest#getSession(true)` (without further interaction with that `HttpServletRequest`) it will return a new instance of `MockHttpSession`, _unless_ there already is an instance of `MockHttpSession`.\r\n\r\nThese changes would make the `MockHttpServletRequest` a bit more conformant to the Servlet spec.\r\nHow would you feel about such changes? I can contribute a PR if the above suggestions would be approved.\r\n"}}
{"actor":{"display_login":"mthmulders"}}