@Test
  public void testSecurityContextSaves() {
    TestSecurityContextHolder.setContext(context);

    testSecurityContext().postProcessRequest(request);

    verify(repository).saveContext(eq(context), eq(request), any(HttpServletResponse.class));
  }
 @After
 public void cleanup() {
   TestSecurityContextHolder.clearContext();
 }
 public MockHttpServletRequest postProcessRequest(MockHttpServletRequest request) {
   save(TestSecurityContextHolder.getContext(), request);
   return request;
 }