@Test void testLoadContextTokenRequest() { MockHttpServletRequest request = new MockHttpServletRequest(); request.setParameter("molgenis-token", "my_token"); MockHttpServletResponse response = new MockHttpServletResponse(); HttpRequestResponseHolder holder = new HttpRequestResponseHolder(request, response); SecurityContext securityContext = mock(SecurityContext.class); when(tokenSecurityContextRepository.loadContext(holder)).thenReturn(securityContext); assertEquals(securityContext, tokenAwareSecurityContextRepository.loadContext(holder)); }
@Override public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { HttpServletRequest request = requestResponseHolder.getRequest(); return getSecurityContextRepository(request).loadContext(requestResponseHolder); }
TokenAwareSecurityContextRepository implements SecurityContextRepository { @Override public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { HttpServletRequest request = requestResponseHolder.getRequest(); return getSecurityContextRepository(request).loadContext(requestResponseHolder); } }
TokenAwareSecurityContextRepository implements SecurityContextRepository { @Override public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { HttpServletRequest request = requestResponseHolder.getRequest(); return getSecurityContextRepository(request).loadContext(requestResponseHolder); } TokenAwareSecurityContextRepository(
      SecurityContextRepository tokenSecurityContextRepository,
      SecurityContextRepository defaultSecurityContextRepository); }
TokenAwareSecurityContextRepository implements SecurityContextRepository { @Override public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { HttpServletRequest request = requestResponseHolder.getRequest(); return getSecurityContextRepository(request).loadContext(requestResponseHolder); } TokenAwareSecurityContextRepository(
      SecurityContextRepository tokenSecurityContextRepository,
      SecurityContextRepository defaultSecurityContextRepository); @Override SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder); @Override void saveContext(
      SecurityContext context, HttpServletRequest request, HttpServletResponse response); @Override boolean containsContext(HttpServletRequest request); }
TokenAwareSecurityContextRepository implements SecurityContextRepository { @Override public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) { HttpServletRequest request = requestResponseHolder.getRequest(); return getSecurityContextRepository(request).loadContext(requestResponseHolder); } TokenAwareSecurityContextRepository(
      SecurityContextRepository tokenSecurityContextRepository,
      SecurityContextRepository defaultSecurityContextRepository); @Override SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder); @Override void saveContext(
      SecurityContext context, HttpServletRequest request, HttpServletResponse response); @Override boolean containsContext(HttpServletRequest request);  }