Skip to content

roar-skinderviken/spring-kafka-streams-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-kafka-streams-demo

A lightweight Spring Boot application demonstrating how to configure Kafka Streams for testing. Includes examples of various testing strategies.

Overview

Topology Configuration

A topology for a very rudimentary card transaction fraud detection is defines in FraudDetectionTopologyConfig.

Testing Approaches

1. Unit Test with TopologyTestDriver

Tests the topology in isolation using Kafka Streams' TopologyTestDriver. See: FraudDetectionTopologyTestDriverTest.

2. Message Validation with KafkaTestUtils

Verifies that messages produced by the topology are correctly published to the output topic. This approach uses a consumer, KafkaTestUtils, and @EmbeddedKafka. See: FraudDetectionKafkaTestUtilsTest.

3. Integration Testing with @MockitoBean and @EmbeddedKafka

Validates that the expected service methods are invoked during the integration test. See: FraudDetectionIntegrationTest.

Prerequisites

  • Java 21+

Running Tests

./gradlew clean check --info

About

A lightweight Spring Boot application demonstrating how to configure Kafka Streams for testing. Includes examples of various testing strategies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages