nerdexam
Confluent

CCDAK · Question #219

Drag and Drop Question Match the testing tool with the type of test it is typically used to perform. To answer, please move each of the options below to the corresponding answer area. Partial credit…

The correct answer is MockProducer; Testcontainers; Trogdor; Connect Datagen. Kafka Testing Tools - Drag & Drop Explanation The question matches each tool to its test type. The implied categories (based on the correct arrangement) are: | Position | Tool | Test Type | |----------|------|-----------| | 1 | MockProducer | Unit Testing | | 2 | Testcontainers…

Development

Question

Drag and Drop Question Match the testing tool with the type of test it is typically used to perform. To answer, please move each of the options below to the corresponding answer area. Partial credit is given for each correct answer. Answer:

Exhibit

CCDAK question #219 exhibit

Answer Area

Drag items

MockProducerTrogdorTestcontainersConnect Datagen

Correct arrangement

  • MockProducer
  • Testcontainers
  • Trogdor
  • Connect Datagen

Explanation

Kafka Testing Tools - Drag & Drop Explanation

The question matches each tool to its test type. The implied categories (based on the correct arrangement) are:

PositionToolTest Type
1MockProducerUnit Testing
2TestcontainersIntegration Testing
3TrogdorPerformance / Fault Testing
4Connect DatagenTest Data Generation

Item-by-Item Breakdown

1. MockProducer → Unit Testing

MockProducer is a class in the Kafka client library (org.apache.kafka.clients.producer.MockProducer). It implements the Producer<K,V> interface but never connects to a real broker - all messages are stored in memory. This makes it ideal for unit tests where you want to test your producer logic in isolation without any infrastructure dependency.

Common mistake: Confusing it with a stub or thinking it requires a running Kafka cluster. It requires nothing - it's purely in-process.


2. Testcontainers → Integration Testing

Testcontainers is a library that spins up real Docker containers (e.g., a real Kafka broker) during a test run, then tears them down afterward. Because you're testing against a real broker, this is classic integration testing - verifying that your application works correctly with actual Kafka behavior.

Common mistake: Thinking this is for unit tests. It requires Docker and is heavier-weight - the point is to test real interactions, not isolate components.


3. Trogdor → Performance / Fault / Stress Testing

Trogdor is Apache Kafka's built-in distributed test framework designed for performance benchmarking and fault injection (chaos engineering). It can simulate broker failures, network partitions, and high-throughput workloads across a real cluster.

Common mistake: Conflating it with load generators. Trogdor is specifically a system-level tool for stress and fault testing at scale - not something used in a CI unit test pipeline.


4. Connect Datagen → Test Data Generation

The Kafka Connect Datagen connector (from Confluent) is a source connector that generates synthetic, schema-based data and publishes it to Kafka topics. It's used when you need realistic-looking test data flowing through your pipeline without a real upstream system.

Common mistake: Thinking this is a testing framework. It doesn't assert anything - it purely generates data (e.g., users, transactions, pageviews using Avro schemas) to feed into downstream consumers for testing.


Memory Aid

Unit → Mock it (MockProducer) Integration → Container it (Testcontainers) Performance/Fault → Burn it (Trogdor) Data Gen → Fake it (Connect Datagen)

Topics

#testing tools#unit testing#integration testing

Community Discussion

No community discussion yet for this question.

Full CCDAK Practice