Class AuthorizerConfigTest

java.lang.Object
org.apache.kafka.server.authorizer.AuthorizerConfigTest

public class AuthorizerConfigTest extends Object
  • Constructor Details

    • AuthorizerConfigTest

      public AuthorizerConfigTest()
  • Method Details

    • setUp

      @BeforeEach public void setUp()
    • tearDown

      @AfterEach public void tearDown()
    • testDefaultMaxAcls

      @Test public void testDefaultMaxAcls()
    • testMaxAcls

      @Test public void testMaxAcls()
    • testGaugeTagsExposeTenantAndMaxAcls

      @Test public void testGaugeTagsExposeTenantAndMaxAcls()
    • testAddAclCountMetricRegistersGaugeReadingZeroForLkcWithoutAcls

      @Test public void testAddAclCountMetricRegistersGaugeReadingZeroForLkcWithoutAcls()
    • testGaugeTracksLoadedCount

      @Test public void testGaugeTracksLoadedCount()
    • testStaleGaugesAreDeregisteredOnTenantDrained

      @Test public void testStaleGaugesAreDeregisteredOnTenantDrained()
      Regression for the typo where the "remove" branch of AuthorizerConfig.loadNewTenantIdToAclCount(Map) called addAclCountMetric instead of deleteAclCountMetric, leaving stale gauges registered after a tenant's ACLs drained.
    • testMetricRegistrationIsNoOpWithoutMetrics

      @Test public void testMetricRegistrationIsNoOpWithoutMetrics()
    • testGaugeIsDeregisteredAfterEffectiveMaxAclsDrift

      @Test public void testGaugeIsDeregisteredAfterEffectiveMaxAclsDrift()
      Regression test for the gauge's label-drift trap: its MetricName embeds the effective max-acls in the tag set, but AuthorizerConfig.setDefaultMaxAcls(Integer) (and the tenant-default branch of AuthorizerConfig.setTenantMaxAcls(Optional, Optional)) update the effective value without re-registering the gauge. Reconstructing the MetricName at deletion time would miss the registered gauge in those cases; using the recorded name avoids the leak.
    • tenantConfigSourceIsConsultedAfterPushButBeforeBrokerDefault

      @Test public void tenantConfigSourceIsConsultedAfterPushButBeforeBrokerDefault()
    • pushOverrideBeatsTenantConfigSource

      @Test public void pushOverrideBeatsTenantConfigSource()
    • tenantConfigSourceIsLazilyConsulted

      @Test public void tenantConfigSourceIsLazilyConsulted()
    • nullTenantIdSkipsTenantConfigSource

      @Test public void nullTenantIdSkipsTenantConfigSource()
    • emptySourceFallsThroughToBrokerDefault

      @Test public void emptySourceFallsThroughToBrokerDefault()
    • sourceEntryWithoutKeyFallsThroughToBrokerDefault

      @Test public void sourceEntryWithoutKeyFallsThroughToBrokerDefault()
    • nullTenantConfigSourceIsRejected

      @Test public void nullTenantConfigSourceIsRejected()