anchor.diff:  === Starting Kafka in a test resource
   
   Alternatively, you can start a Kafka broker in a test resource.
  -The following snippet shows a test resource starting a Kafka broker using https://www.testcontainers.org/modules/kafka/[Test Containers]:
  +The following snippet shows a test resource starting a Kafka broker using https://www.testcontainers.org/modules/kafka/[Testcontainers]:
   
   [source, java]
   ----
  
positive.code: @QuarkusTestResource(KafkaTestResourceLifecycleManager.class)
  class BaristaTest {
  
      @Inject  @Any
      InMemoryConnector connector; // <1>
  
      @Test
  
negative.code:     }
  }
  ----
  1. Configure the Kafka bootstrap location, so the application connects to this broker.
  
  == Authenticating with OAuth
  
  If your Kafka broker uses OAuth as authentication mechanism, you need to configure the Kafka consumer to enable this authentication process.
  First, add the following dependency to your application:
  
  [source, xml]
  ----
  <dependency>
      <groupId>io.strimzi</groupId>
      <artifactId>kafka-oauth-client</artifactId>
  </dependency>
  ----
  
  This dependency provides the callback handler required to handle the OAuth workflow.
  Then, in the `application.properties`, add:
  
  [source, properties]
  ----
  mp.messaging.connector.smallrye-kafka.security.protocol=SASL_PLAINTEXT
  mp.messaging.connector.smallrye-kafka.sasl.mechanism=OAUTHBEARER
  mp.messaging.connector.smallrye-kafka.sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required \
    oauth.client.id="team-a-client" \
    oauth.client.secret="team-a-client-secret" \
    oauth.token.endpoint.uri="http://keycloak:8080/auth/realms/kafka-authz/protocol/openid-connect/token" ;
  mp.messaging.connector.smallrye-kafka.sasl.login.callback.handler.class=io.strimzi.kafka.oauth.client.JaasClientOauthLoginCallbackHandler
  ----
  
  Update the `oauth.client.id`, `oauth.client.secret` and `oauth.token.endpoint.uri` values.
  
  OAuth authentication works for both JVM and native modes.
  
  == Going further
  
  