title: Injecting principal in controller test
body: <p>I would like to inject principal object in controller test, but it is always null. Im already setting the authentication object to SecurityContextHolder</p>
  
  <pre><code>SecurityContextHolder.getContext().setAuthentication(authentication);
  </code></pre>
  
  <p>this is my setup before </p>
  
  <pre><code>@Autowired
      private WebApplicationContext wac;
  
   @Before
      public void abstractControllerSetUp() {
          securityUser = getPrincipal();
          authentication = logIn();
          mockMvc = webAppContextSetup(wac).build();
      }
  </code></pre>
  
  <p>but when I call </p>
  
  <pre><code>mockMvc.perform(put("/partner/notifications/activate")
                  .content(toJson(command))
                  .with(user(securityUser))
                  .contentType(MediaType.APPLICATION_JSON))
                  .andExpect(status().isOk());
  </code></pre>
  
  <p>the principal is alwyas null, it works when app running.</p>
  
  <pre><code>@PutMapping("/activate")
      public void activateNotification(@RequestBody NotificationCommand command, @AuthenticationPrincipal Principal principal) {
  </code></pre>