File tree Expand file tree Collapse file tree 5 files changed +29
-22
lines changed
test/kotlin/com/rogervinas/kafkastreams/stream Expand file tree Collapse file tree 5 files changed +29
-22
lines changed Original file line number Diff line number Diff line change 1616 - name : Set up Java
1717 uses : actions/setup-java@v3
1818 with :
19- java-version : 11
19+ java-version : ' 17 '
2020 distribution : ' temurin'
2121 - name : Gradle cache
2222 uses : actions/cache@v3
Original file line number Diff line number Diff line change 11[ ![ CI] ( https://github.com/rogervinas/spring-cloud-stream-kafka-streams-processor/actions/workflows/gradle.yml/badge.svg?branch=master )] ( https://github.com/rogervinas/spring-cloud-stream-kafka-streams-processor/actions/workflows/gradle.yml )
2- ![ Java] ( https://img.shields.io/badge/Java-11 -blue?labelColor=black )
3- ![ Kotlin] ( https://img.shields.io/badge/Kotlin-1.6 .21-blue?labelColor=black )
2+ ![ Java] ( https://img.shields.io/badge/Java-17 -blue?labelColor=black )
3+ ![ Kotlin] ( https://img.shields.io/badge/Kotlin-1.9 .21-blue?labelColor=black )
44![ SpringBoot] ( https://img.shields.io/badge/SpringBoot-2.7.8-blue?labelColor=black )
55![ SpringCloud] ( https://img.shields.io/badge/SpringCloud-2021.0.8-blue?labelColor=black )
66
Original file line number Diff line number Diff line change @@ -5,19 +5,20 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
55plugins {
66 id(" org.springframework.boot" ) version " 2.7.8"
77 id(" io.spring.dependency-management" ) version " 1.0.15.RELEASE"
8- kotlin(" jvm" ) version " 1.6 .21"
9- kotlin(" plugin.spring" ) version " 1.6 .21"
8+ kotlin(" jvm" ) version " 1.9 .21"
9+ kotlin(" plugin.spring" ) version " 1.9 .21"
1010}
1111
1212group = " com.rogervinas"
1313version = " 0.0.1-SNAPSHOT"
14- java.sourceCompatibility = JavaVersion .VERSION_11
14+ java.sourceCompatibility = JavaVersion .VERSION_17
1515
1616repositories {
1717 mavenCentral()
1818}
1919
2020val springCloudVersion = " 2021.0.8"
21+ val testContainersVersion = " 1.19.3"
2122
2223dependencies {
2324 implementation(" org.jetbrains.kotlin:kotlin-reflect" )
@@ -31,7 +32,9 @@ dependencies {
3132
3233 testImplementation(" org.springframework.boot:spring-boot-starter-test" )
3334 testImplementation(" org.apache.kafka:kafka-streams-test-utils" )
34- testImplementation(" org.testcontainers:junit-jupiter:1.19.3" )
35+
36+ testImplementation(" org.testcontainers:junit-jupiter:$testContainersVersion " )
37+ testImplementation(" org.testcontainers:testcontainers:$testContainersVersion " )
3538}
3639
3740dependencyManagement {
@@ -43,7 +46,7 @@ dependencyManagement {
4346tasks.withType<KotlinCompile > {
4447 kotlinOptions {
4548 freeCompilerArgs = listOf (" -Xjsr305=strict" )
46- jvmTarget = " 11 "
49+ jvmTarget = " 17 "
4750 }
4851}
4952
Original file line number Diff line number Diff line change @@ -2,12 +2,14 @@ spring:
22 application :
33 name : " spring-cloud-stream-kafka-streams-processor"
44 cloud :
5+ function :
6+ definition : userStateStream
57 stream :
6- function :
7- definition : userStateStream
8- bindings :
9- userStateStream-in -0 : " pub.user.token "
10- userStateStream-out-0 : " pub.user.state"
8+ bindings :
9+ userStateStream-in-0 :
10+ destination : " pub.user.token "
11+ userStateStream-out -0 :
12+ destination : " pub.user.state"
1113 kafka :
1214 streams :
1315 binder :
Original file line number Diff line number Diff line change @@ -18,18 +18,20 @@ import java.time.Duration
1818import java.util.Properties
1919import java.util.function.Consumer
2020
21- private const val TOPIC_IN = " topic.in"
22- private const val TOPIC_OUT = " topic.out"
21+ class UserStreamTest {
2322
24- private const val USERNAME_1 = " user1"
25- private const val USERNAME_2 = " user2"
26- private const val USERNAME_3 = " user3"
27- private const val USERNAME_4 = " user4"
23+ companion object {
24+ private const val TOPIC_IN = " topic.in"
25+ private const val TOPIC_OUT = " topic.out"
2826
29- private val SCHEDULE = Duration .ofSeconds(1 )
30- private val EXPIRATION = Duration .ofSeconds(5 )
27+ private const val USERNAME_1 = " user1"
28+ private const val USERNAME_2 = " user2"
29+ private const val USERNAME_3 = " user3"
30+ private const val USERNAME_4 = " user4"
3131
32- class UserStreamTest {
32+ private val SCHEDULE = Duration .ofSeconds(1 )
33+ private val EXPIRATION = Duration .ofSeconds(5 )
34+ }
3335
3436 private lateinit var topologyTestDriver: TopologyTestDriver
3537 private lateinit var topicIn: TestInputTopic <String , UserTokenEvent >
You can’t perform that action at this time.
0 commit comments