ca.gc.aafc.dina.testsupport.security.WithMockKeycloakUser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dina-test-support Show documentation
Show all versions of dina-test-support Show documentation
Base DINA API test support package
The newest version!
package ca.gc.aafc.dina.testsupport.security;
import org.springframework.security.test.context.support.WithSecurityContext;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Annotation used to mock a Keycloak user for testing purpose.
*/
@Retention(RetentionPolicy.RUNTIME)
@WithSecurityContext(factory = WithMockKeycloakSecurityContextFactory.class)
public @interface WithMockKeycloakUser {
String username() default "test user";
/**
* Format {"group:role", "group2:role2"}
*
* @return
*/
String[] groupRole() default "";
String agentIdentifier() default "";
String internalIdentifier() default "";
boolean failOnInvalidNotation() default true;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy