Skip to content

Commit c000477

Browse files
committed
Polish Clarify @WithSecurityContext thread scope
1 parent 2a013ff commit c000477

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/modules/ROOT/pages/servlet/test/method.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ You can change this to happen during the `TestExecutionListener.beforeTestExecut
187187
[NOTE]
188188
====
189189
`@WithMockUser`, `@WithUserDetails`, and `@WithSecurityContext` populate the xref:servlet/authentication/architecture.adoc#servlet-authentication-securitycontextholder[`SecurityContextHolder`] for the test thread.
190-
This works for method-security tests and for xref:servlet/test/mockmvc/index.adoc[`MockMvc`] (when using `testSecurityContext()`), but does not automatically apply to full HTTP requests made through external clients (for example, REST-assured against a running server), because those requests are handled on a different thread.
190+
This cannot apply to full HTTP requests a test makes to a running server since those requests are handled by a different thread.
191191
For end-to-end HTTP tests, xref:servlet/authentication/index.adoc[authenticate] the request itself (for example, with HTTP Basic or a bearer token).
192192
====
193193

0 commit comments

Comments
 (0)