Class AbstractTransportLayerTest

java.lang.Object
org.apache.kafka.common.network.AbstractTransportLayerTest

public class AbstractTransportLayerTest extends Object
  • Constructor Details

    • AbstractTransportLayerTest

      public AbstractTransportLayerTest()
  • Method Details

    • testMaybeReadAndProcessProxyHeaders_peerNotInRange_skipsProcessing

      @Test public void testMaybeReadAndProcessProxyHeaders_peerNotInRange_skipsProcessing() throws Exception
      When the peer IP is NOT in the accepted range, PROXY header processing should be skipped and the engine should be marked as skipped.
      Throws:
      Exception
    • testMaybeReadAndProcessProxyHeaders_peerInRange_processesHeaders

      @Test public void testMaybeReadAndProcessProxyHeaders_peerInRange_processesHeaders() throws Exception
      When the peer IP IS in the accepted range, PROXY header processing should proceed normally (processHeaders is called, skipProcessing is not).
      Throws:
      Exception
    • testMaybeReadAndProcessProxyHeaders_noRangeConfigured_processesNormally

      @Test public void testMaybeReadAndProcessProxyHeaders_noRangeConfigured_processesNormally() throws Exception
      When no accepted IP range is configured, PROXY header processing should proceed unconditionally.
      Throws:
      Exception
    • testEnableIpFiltering_proxySkipped_returnsTrue

      @Test public void testEnableIpFiltering_proxySkipped_returnsTrue() throws Exception
      When PROXY processing was skipped (peer not in range), enableIpFiltering() should return true so the peer IP (which IS the real client IP) gets filtered.
      Throws:
      Exception
    • testEnableIpFiltering_proxyFallbackNoClientInfo_returnsFalse

      @Test public void testEnableIpFiltering_proxyFallbackNoClientInfo_returnsFalse() throws Exception
      When PROXY was expected and processed but has no client info (fallback), enableIpFiltering() should return false (fail open) — this is the existing behavior.
      Throws:
      Exception