Annotation Type WithSecurityContext
-
@Target(ANNOTATION_TYPE) @Retention(RUNTIME) @Inherited @Documented public @interface WithSecurityContext
An annotation to determine what
SecurityContext
to use. Thefactory()
attribute must be provided with an instance ofWithUserDetailsSecurityContextFactory
.Typically this annotation will be used as an meta-annotation as done with
WithMockUser
andWithUserDetails
.If you would like to create your own implementation of
WithSecurityContextFactory
you can do so by implementing the interface. You can also useAutowired
and other Spring semantics on theWithSecurityContextFactory
implementation.- Since:
- 4.0
- Author:
- Rob Winch
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description Class<? extends WithSecurityContextFactory<? extends Annotation>>
factory
TheWithUserDetailsSecurityContextFactory
to use to create theSecurityContext
.
-
-
-
Element Detail
-
factory
Class<? extends WithSecurityContextFactory<? extends Annotation>> factory
TheWithUserDetailsSecurityContextFactory
to use to create theSecurityContext
. It can containAutowired
and other Spring annotations.- Returns:
-
-