Class NimbusClientTest

java.lang.Object
net.shibboleth.idp.plugin.authn.duo.nimbus.impl.NimbusClientTest

public class NimbusClientTest extends Object
Tests for the NimbusClient class.
  • Field Details

  • Constructor Details

    • NimbusClientTest

      public NimbusClientTest()
  • Method Details

    • setup

      @BeforeMethod public void setup() throws Exception
      Throws:
      Exception
    • testTokenExchange

      public void testTokenExchange() throws Exception
      Test the token exchange works using a mocked HTTP client and response. Does not check the signature is valid. Given the amount of mocking, is not a very thorough test.
      Throws:
      Exception - on error.
    • testTokenExchangeInternalServerErrorResponse

      public void testTokenExchangeInternalServerErrorResponse() throws Exception
      Test an exception is thrown if a non-OK http response is returned. There is no known response body, so an empty one is used.
      Throws:
      Exception - on error.
    • testHealthCheck

      public void testHealthCheck() throws Exception
      Test the health check using a mocked HTTP client and response. Given the amount of mocking, is not a very thorough test.
      Throws:
      Exception - on error
    • testHealthCheckMoreFields

      public void testHealthCheckMoreFields() throws Exception
      Test the health check using a mocked HTTP client and response. Given the amount of mocking, is not a very thorough test. The response contains more fields than known, should not fail.
      Throws:
      Exception - on error
    • testHealthCheckError

      public void testHealthCheckError() throws Exception
      Test the health check using a mocked HTTP client and response. Given the amount of mocking, is not a very thorough test. The response shows a failure.
      Throws:
      Exception - on error
    • testHealthEndpointTimeout

      public void testHealthEndpointTimeout() throws Exception
      Throws:
      Exception
    • testAuthURL

      public void testAuthURL() throws DuoClientException
      Test the auth URL is constructed correctly.
      Throws:
      DuoClientException - on error.
    • testAuthURLWithOverrideRedirect

      public void testAuthURLWithOverrideRedirect() throws DuoClientException, UnsupportedEncodingException
      Test the auth URL is constructed correctly when an override redirectURI is supplied.
      Throws:
      DuoClientException - on error.
      UnsupportedEncodingException - on error.