use of org.springframework.mock.web.MockHttpServletRequest in project spring-security by spring-projects.
the class AccessControlListTagTests method setup.
@Before
@SuppressWarnings("rawtypes")
public void setup() {
SecurityContextHolder.getContext().setAuthentication(bob);
tag = new AccessControlListTag();
WebApplicationContext ctx = mock(WebApplicationContext.class);
pe = mock(PermissionEvaluator.class);
Map beanMap = new HashMap();
beanMap.put("pe", pe);
when(ctx.getBeansOfType(PermissionEvaluator.class)).thenReturn(beanMap);
MockServletContext servletCtx = new MockServletContext();
servletCtx.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ctx);
pageContext = new MockPageContext(servletCtx, new MockHttpServletRequest(), new MockHttpServletResponse());
tag.setPageContext(pageContext);
}
use of org.springframework.mock.web.MockHttpServletRequest in project spring-security by spring-projects.
the class SecurityMockMvcRequestPostProcessorsDigestTests method digestWithFilterCustomRealm.
@Test
public void digestWithFilterCustomRealm() throws Exception {
String username = "admin";
entryPoint.setRealmName("Custom");
MockHttpServletRequest postProcessedRequest = digest(username).realm(entryPoint.getRealmName()).postProcessRequest(request);
assertThat(extractUser()).isEqualTo(username);
}
use of org.springframework.mock.web.MockHttpServletRequest in project spring-security by spring-projects.
the class SecurityMockMvcRequestPostProcessorsSecurityContextTests method setup.
@Before
public void setup() {
request = new MockHttpServletRequest();
mockWebTestUtils();
}
use of org.springframework.mock.web.MockHttpServletRequest in project spring-security by spring-projects.
the class SecurityMockMvcRequestPostProcessorsUserDetailsTests method setup.
@Before
public void setup() {
request = new MockHttpServletRequest();
mockWebTestUtils();
}
use of org.springframework.mock.web.MockHttpServletRequest in project spring-security by spring-projects.
the class SecurityMockMvcRequestPostProcessorsUserTests method setup.
@Before
public void setup() {
request = new MockHttpServletRequest();
mockWebTestUtils();
}
Aggregations