Search in sources :

Example 1 with MockHttpSession

use of cn.taketoday.mock.web.MockHttpSession in project today-infrastructure by TAKETODAY.

the class ClassPathBeanDefinitionScannerScopeIntegrationTests method setup.

@BeforeEach
void setup() {
    MockHttpServletRequest oldRequestWithSession = new MockHttpServletRequest();
    oldRequestWithSession.setSession(new MockHttpSession());
    this.oldRequestAttributesWithSession = new ServletRequestContext(null, oldRequestWithSession, new MockHttpServletResponse());
    MockHttpServletRequest newRequestWithSession = new MockHttpServletRequest();
    newRequestWithSession.setSession(new MockHttpSession());
    this.newRequestAttributesWithSession = new ServletRequestContext(null, newRequestWithSession, new MockHttpServletResponse());
}
Also used : MockHttpServletRequest(cn.taketoday.mock.web.MockHttpServletRequest) MockHttpSession(cn.taketoday.mock.web.MockHttpSession) ServletRequestContext(cn.taketoday.web.servlet.ServletRequestContext) MockHttpServletResponse(cn.taketoday.mock.web.MockHttpServletResponse) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with MockHttpSession

use of cn.taketoday.mock.web.MockHttpSession in project today-framework by TAKETODAY.

the class ClassPathBeanDefinitionScannerScopeIntegrationTests method setup.

@BeforeEach
void setup() {
    MockHttpServletRequest oldRequestWithSession = new MockHttpServletRequest();
    oldRequestWithSession.setSession(new MockHttpSession());
    this.oldRequestAttributesWithSession = new ServletRequestContext(null, oldRequestWithSession, new MockHttpServletResponse());
    MockHttpServletRequest newRequestWithSession = new MockHttpServletRequest();
    newRequestWithSession.setSession(new MockHttpSession());
    this.newRequestAttributesWithSession = new ServletRequestContext(null, newRequestWithSession, new MockHttpServletResponse());
}
Also used : MockHttpServletRequest(cn.taketoday.mock.web.MockHttpServletRequest) MockHttpSession(cn.taketoday.mock.web.MockHttpSession) ServletRequestContext(cn.taketoday.web.servlet.ServletRequestContext) MockHttpServletResponse(cn.taketoday.mock.web.MockHttpServletResponse) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

MockHttpServletRequest (cn.taketoday.mock.web.MockHttpServletRequest)2 MockHttpServletResponse (cn.taketoday.mock.web.MockHttpServletResponse)2 MockHttpSession (cn.taketoday.mock.web.MockHttpSession)2 ServletRequestContext (cn.taketoday.web.servlet.ServletRequestContext)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2