Skip to content

Instantly share code, notes, and snippets.

@rponte
Last active March 19, 2022 22:06
Show Gist options
  • Select an option

  • Save rponte/3167731 to your computer and use it in GitHub Desktop.

Select an option

Save rponte/3167731 to your computer and use it in GitHub Desktop.
Setting up Spring Security current user into integration tests
@Before
public void setup() {
SecurityContextHolder.getContext().setAuthentication(
new UsernamePasswordAuthenticationToken(username, password));
}
@rponte
Copy link
Copy Markdown
Author

rponte commented Jul 24, 2012

@rponte
Copy link
Copy Markdown
Author

rponte commented Feb 24, 2021

@rponte
Copy link
Copy Markdown
Author

rponte commented Feb 24, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment