|
| 1 | +# 0.20.0 (To be released) |
| 2 | + |
| 3 | +**Release Date:** To be released |
| 4 | + |
| 5 | +This release introduces: |
| 6 | + |
| 7 | +- **Spring Boot 4.x Support**: Full support for Spring Boot 4.x and Spring Kafka 4.x |
| 8 | +- **Unified Spring Modules**: Single modules that work across Spring Boot 2.x, 3.x, and 4.x |
| 9 | +- **New Bean Registration DSL**: `stoveSpring4xRegistrar` for Spring Boot 4.x (since `BeanDefinitionDsl` is deprecated) |
| 10 | +- **Runtime Version Checks**: Clear error messages when Spring Boot/Kafka is missing from classpath |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## New Features |
| 15 | + |
| 16 | +### Spring Boot 4.x Support |
| 17 | + |
| 18 | +Stove now fully supports Spring Boot 4.x and Spring Kafka 4.x. The existing `stove-spring-testing-e2e` and `stove-spring-testing-e2e-kafka` modules work with all Spring Boot versions (2.x, 3.x, and 4.x). |
| 19 | + |
| 20 | +**Dependencies remain the same:** |
| 21 | + |
| 22 | +```kotlin |
| 23 | +testImplementation("com.trendyol:stove-spring-testing-e2e:0.20.0") |
| 24 | +testImplementation("com.trendyol:stove-spring-testing-e2e-kafka:0.20.0") |
| 25 | +``` |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +### New Bean Registration DSL for Spring Boot 4.x |
| 30 | + |
| 31 | +Spring Boot 4.x deprecates `BeanDefinitionDsl` (`beans { }` DSL). Stove provides new extension functions for cleaner bean registration: |
| 32 | + |
| 33 | +**Spring Boot 2.x / 3.x - use `addTestDependencies`:** |
| 34 | + |
| 35 | +```kotlin |
| 36 | +import com.trendyol.stove.testing.e2e.addTestDependencies |
| 37 | + |
| 38 | +springBoot( |
| 39 | + runner = { params -> |
| 40 | + runApplication<MyApp>(args = params) { |
| 41 | + addTestDependencies { |
| 42 | + bean<TestSystemKafkaInterceptor<*, *>>() |
| 43 | + bean<MyService> { MyServiceImpl() } |
| 44 | + } |
| 45 | + } |
| 46 | + } |
| 47 | +) |
| 48 | +``` |
| 49 | + |
| 50 | +**Spring Boot 4.x - use `addTestDependencies4x`:** |
| 51 | + |
| 52 | +```kotlin |
| 53 | +import com.trendyol.stove.testing.e2e.addTestDependencies4x |
| 54 | + |
| 55 | +springBoot( |
| 56 | + runner = { params -> |
| 57 | + runApplication<MyApp>(args = params) { |
| 58 | + addTestDependencies4x { |
| 59 | + registerBean<TestSystemKafkaInterceptor<*, *>>(primary = true) |
| 60 | + registerBean<MyService> { MyServiceImpl() } |
| 61 | + } |
| 62 | + } |
| 63 | + } |
| 64 | +) |
| 65 | +``` |
| 66 | + |
| 67 | +**Alternative: Using `addInitializers` directly:** |
| 68 | + |
| 69 | +```kotlin |
| 70 | +// Spring Boot 2.x / 3.x |
| 71 | +addInitializers(stoveSpringRegistrar { bean<MyService>() }) |
| 72 | + |
| 73 | +// Spring Boot 4.x |
| 74 | +addInitializers(stoveSpring4xRegistrar { registerBean<MyService>() }) |
| 75 | +``` |
| 76 | + |
| 77 | +**Key differences for 4.x:** |
| 78 | +- Use `registerBean<T>()` instead of `bean<T>()` |
| 79 | +- Use `registerBean<T>(primary = true)` for primary beans |
| 80 | +- No `ref()` function - use constructor injection instead |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +### Runtime Version Checks |
| 85 | + |
| 86 | +When Spring Boot or Spring Kafka is missing from the classpath, Stove now provides clear error messages: |
| 87 | + |
| 88 | +``` |
| 89 | +═══════════════════════════════════════════════════════════════════════════════ |
| 90 | + Spring Boot Not Found on Classpath! |
| 91 | +═══════════════════════════════════════════════════════════════════════════════ |
| 92 | +
|
| 93 | + stove-spring-testing-e2e requires Spring Boot to be on your classpath. |
| 94 | + Spring Boot is declared as a 'compileOnly' dependency, so you must add it |
| 95 | + to your project. |
| 96 | +
|
| 97 | + Add one of the following to your build.gradle.kts: |
| 98 | +
|
| 99 | + For Spring Boot 2.x: |
| 100 | + testImplementation("org.springframework.boot:spring-boot-starter:2.7.x") |
| 101 | +
|
| 102 | + For Spring Boot 3.x: |
| 103 | + testImplementation("org.springframework.boot:spring-boot-starter:3.x.x") |
| 104 | +
|
| 105 | + For Spring Boot 4.x: |
| 106 | + testImplementation("org.springframework.boot:spring-boot-starter:4.x.x") |
| 107 | +
|
| 108 | +═══════════════════════════════════════════════════════════════════════════════ |
| 109 | +``` |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +## Migration Guide |
| 114 | + |
| 115 | +### From 0.19.x |
| 116 | + |
| 117 | +#### For Spring Boot 2.x and 3.x Users |
| 118 | + |
| 119 | +**If using `BaseApplicationContextInitializer`:** Migrate to `addTestDependencies` (see Breaking Changes above). |
| 120 | + |
| 121 | +**If using `beans { }` directly:** Your existing code continues to work. Optionally, use the new cleaner API: |
| 122 | + |
| 123 | +```kotlin |
| 124 | +// Old way (still works) |
| 125 | +addInitializers(beans { bean<MyService>() }) |
| 126 | + |
| 127 | +// New way (recommended) |
| 128 | +addTestDependencies { bean<MyService>() } |
| 129 | +``` |
| 130 | + |
| 131 | +#### For Spring Boot 4.x Users (New!) |
| 132 | + |
| 133 | +Spring Boot 4.x is newly supported in this release. Use `addTestDependencies4x`: |
| 134 | + |
| 135 | +```kotlin |
| 136 | +import com.trendyol.stove.testing.e2e.addTestDependencies4x |
| 137 | + |
| 138 | +springBoot( |
| 139 | + runner = { params -> |
| 140 | + runApplication<MyApp>(args = params) { |
| 141 | + addTestDependencies4x { |
| 142 | + registerBean<TestSystemKafkaInterceptor<*, *>>(primary = true) |
| 143 | + registerBean<MyService> { MyServiceImpl() } |
| 144 | + } |
| 145 | + } |
| 146 | + } |
| 147 | +) |
| 148 | +``` |
| 149 | + |
| 150 | +Note: The `beans { }` DSL from Spring is deprecated in 4.x, which is why Stove provides `addTestDependencies4x` with `registerBean<T>()`. |
| 151 | + |
| 152 | +--- |
| 153 | + |
| 154 | +### Breaking Changes |
| 155 | + |
| 156 | +#### `BaseApplicationContextInitializer` Removed |
| 157 | + |
| 158 | +`BaseApplicationContextInitializer` has been removed. Migrate to `addTestDependencies`: |
| 159 | + |
| 160 | +**Before (0.19.0):** |
| 161 | + |
| 162 | +```kotlin |
| 163 | +class TestSystemInitializer : BaseApplicationContextInitializer({ |
| 164 | + bean<TestSystemKafkaInterceptor<*, *>>() |
| 165 | + bean<MyService> { MyServiceImpl() } |
| 166 | +}) |
| 167 | + |
| 168 | +// Usage |
| 169 | +runApplication<MyApp>(args = params) { |
| 170 | + addInitializers(TestSystemInitializer()) |
| 171 | +} |
| 172 | +``` |
| 173 | + |
| 174 | +**After (0.20.0):** |
| 175 | + |
| 176 | +```kotlin |
| 177 | +import com.trendyol.stove.testing.e2e.addTestDependencies |
| 178 | + |
| 179 | +runApplication<MyApp>(args = params) { |
| 180 | + addTestDependencies { |
| 181 | + bean<TestSystemKafkaInterceptor<*, *>>() |
| 182 | + bean<MyService> { MyServiceImpl() } |
| 183 | + } |
| 184 | +} |
| 185 | +``` |
| 186 | + |
| 187 | +This is simpler - no need to create a separate class. |
| 188 | + |
| 189 | +--- |
| 190 | + |
| 191 | +### Notes |
| 192 | + |
| 193 | +#### Dead Letter Topic Naming Convention (Spring Kafka) |
| 194 | + |
| 195 | +Be aware that Spring Kafka changed the default DLT (Dead Letter Topic) naming convention between versions: |
| 196 | + |
| 197 | +| Spring Kafka Version | DLT Suffix | Example | |
| 198 | +|---------------------|------------|---------| |
| 199 | +| 2.x | `.DLT` | `my-topic.DLT` | |
| 200 | +| 3.x, 4.x | `-dlt` | `my-topic-dlt` | |
| 201 | + |
| 202 | +This is not a Stove change, but something to be aware of when writing Kafka tests across different Spring Kafka versions. |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +## Dependency Updates |
| 207 | + |
| 208 | +- Spring Boot 4.x support (4.0.0+) |
| 209 | +- Spring Kafka 4.x support (4.0.0+) |
| 210 | +- Continued support for Spring Boot 2.7.x and 3.x |
| 211 | +- Continued support for Spring Kafka 2.9.x and 3.x |
| 212 | + |
| 213 | +--- |
| 214 | + |
| 215 | +## Full Changelog |
| 216 | + |
| 217 | +See the [GitHub Releases](https://github.com/Trendyol/stove/releases) page for the complete list of commits and contributors. |
| 218 | + |
| 219 | +--- |
| 220 | + |
| 221 | +## Contributors |
| 222 | + |
| 223 | +Thanks to all contributors who made this release possible! |
| 224 | + |
| 225 | +--- |
| 226 | + |
| 227 | +## Getting Started |
| 228 | + |
| 229 | +```kotlin |
| 230 | +dependencies { |
| 231 | + testImplementation("com.trendyol:stove-testing-e2e:0.20.0") |
| 232 | + testImplementation("com.trendyol:stove-spring-testing-e2e:0.20.0") |
| 233 | + // Add component-specific dependencies as needed |
| 234 | + testImplementation("com.trendyol:stove-spring-testing-e2e-kafka:0.20.0") |
| 235 | +} |
| 236 | +``` |
| 237 | + |
| 238 | +For snapshot versions, add the snapshot repository: |
| 239 | + |
| 240 | +```kotlin |
| 241 | +repositories { |
| 242 | + maven("https://central.sonatype.com/repository/maven-snapshots") |
| 243 | +} |
| 244 | +``` |
0 commit comments