Class BaseSecurityTest

java.lang.Object
org.chenile.security.test.BaseSecurityTest

public class BaseSecurityTest extends Object
A security test container initiating class. Initiates a keycloak container to test security roles. This class can be used in multiple ways:
  • As a super class for your test case.
  • As a utility class that can be called.
  • Packaged within Cucumber. See RestCukesSecSteps
Its main purpose is to generate authorization tokens that can be injected into requests to test secure services. Without these tokens, the requests will be rejected by the Chenile security interceptor.
This keycloak test container will have the following realms / users/ roles /scopes:
RealmUser/PasswordRole(s)Scope(s)
tenant0t0-normal/t0-normalusertest.normal
tenant0t0-premium/t0-premiumuser,user_premiumtest.normal,test.premium
tenant1t1-normal/t1-normalusertest.normal
tenant1t1-premium/t1-premiumuser,user_premiumtest.normal,test.premium
  • Field Details

    • keycloak

      public static dasniko.testcontainers.keycloak.KeycloakContainer keycloak
    • connDetails

      public static BaseSecurityTest.ConnDetails connDetails
  • Constructor Details

    • BaseSecurityTest

      public BaseSecurityTest()
  • Method Details