Class EmbeddedOidcProviderMock

All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.Extension

public class EmbeddedOidcProviderMock extends OidcProviderMockBase implements org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeAllCallback
This class mocks an OIDC provider for tests environments in which no dedicated OIDC provider can be used. WireMock is used to simulate the REST services. It implements JUnit 5 callbacks, so it can be registered as a JUnit extension to automatically start WireMock.
  • Constructor Details

    • EmbeddedOidcProviderMock

      public EmbeddedOidcProviderMock(String host, int port, String issuerPath)
    • EmbeddedOidcProviderMock

      public EmbeddedOidcProviderMock(String host, int port, String issuerPath, int tokenLifespan)
    • EmbeddedOidcProviderMock

      public EmbeddedOidcProviderMock(String host, int port, String issuerPath, String publicKey, String privateKey)
    • EmbeddedOidcProviderMock

      public EmbeddedOidcProviderMock(String host, int port, String issuerPath, String publicKey, String privateKey, int tokenLifespan)
  • Method Details

    • getOidcServer

      public com.github.tomakehurst.wiremock.WireMockServer getOidcServer()
    • beforeAll

      public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
      Specified by:
      beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
    • afterAll

      public void afterAll(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
      Specified by:
      afterAll in interface org.junit.jupiter.api.extension.AfterAllCallback