Annotation Interface WithMockJwtAuth
@Target({METHOD,TYPE})
@Retention(RUNTIME)
@Inherited
@Documented
@WithSecurityContext(factory=JwtAuthenticationTokenFactory.class)
public @interface WithMockJwtAuth
Deprecated.
Annotation to setup test
SecurityContext with an JwtAuthenticationToken. Sample usage:
@Test
@WithMockJwtAuth(
authorities = { "USER", "AUTHORIZED_PERSONNEL" },
claims = @OpenIdClaims(sub = "42"))
public void test() {
...
}
- Author:
- Jérôme Wacongne <ch4mp@c4-soft.com>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDeprecated. -
Optional Element Summary
Optional Elements
-
Element Details
-
value
Deprecated.- Default:
- {}
-
authorities
Deprecated.- Default:
- {}
-
claims
OpenIdClaims claimsDeprecated.- Default:
- @com.c4_soft.springaddons.security.oauth2.test.annotations.OpenIdClaims
-
tokenString
String tokenStringDeprecated.- Default:
- "machin.truc.chose"
-
headers
Claims headersDeprecated.- Default:
- @com.c4_soft.springaddons.security.oauth2.test.annotations.Claims(stringClaims={@com.c4_soft.springaddons.security.oauth2.test.annotations.StringClaim(name="alg", value="none")})
-
setupBefore
@AliasFor(annotation=org.springframework.security.test.context.support.WithSecurityContext.class) org.springframework.security.test.context.support.TestExecutionEvent setupBeforeDeprecated.- Default:
- TEST_METHOD
-
@WithJwtor@WithMockAuthenticationinstead