Class SanUriExtractorTest

java.lang.Object
org.apache.kafka.common.security.ssl.SanUriExtractorTest

public class SanUriExtractorTest extends Object
Uses real, BouncyCastle-signed X.509 certificates (via TestSslUtils) rather than mocks, so these tests exercise the actual ASN.1 SAN extension encoding/decoding that X509Certificate.getSubjectAlternativeNames() performs, not just a canned mock return value.
  • Constructor Details

    • SanUriExtractorTest

      public SanUriExtractorTest()
  • Method Details

    • testSingleUriEntryReturnedAsIs

      @Test public void testSingleUriEntryReturnedAsIs() throws Exception
      Throws:
      Exception
    • testMultipleUriEntriesReturnedInSameOrder

      @Test public void testMultipleUriEntriesReturnedInSameOrder() throws Exception
      Throws:
      Exception
    • testMixedSanTypesOnlyUriEntriesSurvive

      @Test public void testMixedSanTypesOnlyUriEntriesSurvive() throws Exception
      Throws:
      Exception
    • testNoSanExtensionReturnsEmptyListNotNull

      @Test public void testNoSanExtensionReturnsEmptyListNotNull() throws Exception
      Throws:
      Exception
    • testSanExtensionPresentWithNoUriEntriesReturnsEmptyList

      @Test public void testSanExtensionPresentWithNoUriEntriesReturnsEmptyList() throws Exception
      Throws:
      Exception
    • testRelativeUriDroppedButOtherValidEntriesSurvive

      @Test public void testRelativeUriDroppedButOtherValidEntriesSurvive() throws Exception
      Throws:
      Exception
    • testEmptyStringUriEntryDroppedButOtherValidEntriesSurvive

      @Test public void testEmptyStringUriEntryDroppedButOtherValidEntriesSurvive() throws Exception
      Throws:
      Exception
    • testCertificateParsingExceptionFailsClosedToEmptyList

      @Test public void testCertificateParsingExceptionFailsClosedToEmptyList() throws Exception
      Throws:
      Exception