Annotation Interface ParameterizedAuthentication


@Target({ANNOTATION_TYPE,PARAMETER}) @Retention(RUNTIME) @ConvertWith(AuthenticationArgumentProcessor.class) public @interface ParameterizedAuthentication

Shortcut for @ConvertWith(ParameterizedAuthentication.AuthenticationArgumentProcessor.class), which populates the passed @ParameterizedTest parameter.

Usage on tests decorated with @AutoConfigureAddonsSecurity or @AutoConfigureAddonsWebSecurity:
 @Autowired
 WithJwt.AuthenticationFactory authFactory;

 @ParameterizedTest
 @MethodSource("authSource")
 void givenUserIsPersona_whenGetGreet_thenReturnsGreeting(@ParameterizedAuthentication Authentication auth) {
     ...
 }

 Stream<AbstractAuthenticationToken> authSource() {
     return authFactory.authenticationsFrom("ch4mp.json", "tonton-pirate.json");
 }
 
Since:
6.1.12
Author:
Jerome Wacongne ch4mp@c4-soft.com