Package org.chenile.security.test
Class BaseSecurityTest
java.lang.Object
org.chenile.security.test.BaseSecurityTest
A security test container initiating class. Initiates a keycloak container to test security roles.
This class can be used in multiple ways:
This keycloak test container will have the following realms / users/ roles /scopes:
- As a super class for your test case.
- As a utility class that can be called.
- Packaged within Cucumber. See
RestCukesSecSteps
This keycloak test container will have the following realms / users/ roles /scopes:
Realm | User/Password | Role(s) | Scope(s) |
---|---|---|---|
tenant0 | t0-normal/t0-normal | user | test.normal |
tenant0 | t0-premium/t0-premium | user,user_premium | test.normal,test.premium |
tenant1 | t1-normal/t1-normal | user | test.normal |
tenant1 | t1-premium/t1-premium | user,user_premium | test.normal,test.premium |
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
(package private) static final record
-
Field Summary
Modifier and TypeFieldDescriptionstatic BaseSecurityTest.ConnDetails
static dasniko.testcontainers.keycloak.KeycloakContainer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getHost()
static int
static String
static String
getUrl()
static void
keycloakProperties
(DynamicPropertyRegistry registry)
-
Field Details
-
keycloak
public static dasniko.testcontainers.keycloak.KeycloakContainer keycloak -
connDetails
-
-
Constructor Details
-
BaseSecurityTest
public BaseSecurityTest()
-
-
Method Details
-
getHost
-
getUrl
-
getHttpPort
public static int getHttpPort() -
keycloakProperties
-
getToken
-