Annotation Interface OpenId
@Target({METHOD,TYPE})
@Retention(RUNTIME)
@Inherited
@Documented
@WithSecurityContext(factory=AuthenticationFactory.class)
public @interface OpenId
Deprecated.
Annotation to setup test
SecurityContext with an OAuthentication. Sample usage:
@Test
@WithMockOidcId(
authorities = { "USER", "AUTHORIZED_PERSONNEL" },
claims = @OpenIdClaims(
sub = "42",
email = "ch4mp@c4-soft.com",
emailVerified = true,
nickName = "Tonton-Pirate",
preferredUsername = "ch4mpy",
otherClaims = @ClaimSet(stringClaims = @StringClaim(name = "foo", value = "bar"))))
public void test() {
...
}
- Author:
- Jérôme Wacongne <ch4mp@c4-soft.com>
-
Element Details
-
value
Deprecated.- Default:
- {}
-
authorities
Deprecated.- Default:
- {}
-
claims
OpenIdClaims claimsDeprecated.- Default:
- @com.c4_soft.springaddons.security.oauth2.test.annotations.OpenIdClaims
-
bearerString
String bearerStringDeprecated.- Default:
- "machin.truc.chose"
-
setupBefore
@AliasFor(annotation=org.springframework.security.test.context.support.WithSecurityContext.class) org.springframework.security.test.context.support.TestExecutionEvent setupBeforeDeprecated.- Default:
- TEST_METHOD
-
@WithJwtor@WithMockAuthenticationinstead