use of com.vaadin.flow.server.auth.AccessAnnotationChecker in project flow by vaadin.
the class EndpointAccessCheckerTest method before.
@Before
public void before() {
checker = new EndpointAccessChecker(new AccessAnnotationChecker());
requestMock = mock(HttpServletRequest.class);
when(requestMock.getUserPrincipal()).thenReturn(mock(Principal.class));
when(requestMock.getHeader("X-CSRF-Token")).thenReturn("Vaadin Fusion");
when(requestMock.getCookies()).thenReturn(new Cookie[] { new Cookie(ApplicationConstants.CSRF_TOKEN, "Vaadin Fusion") });
when(requestMock.isUserInRole("ROLE_USER")).thenReturn(true);
}
Aggregations