Trendyol / stove

Stove: The easiest way of writing e2e/component tests for your JVM back-end API with Kotlin
https://trendyol.github.io/stove/
Apache License 2.0
174 stars 13 forks source link

spring-kafka: ser/de #658

Closed osoykan closed 10 hours ago

osoykan commented 1 day ago

This pull request includes several changes to improve the serialization mechanism and enhance the Spring Kafka testing infrastructure. It is one of the works that need to be done to improve serialization support when users want to use Protobuf, Avro, JSON(already supported), and other serialization systems.

Most notable change is the change for TestSystemKafkaInterceptor<*,*>. The dependency for this class was an ObjectMapper instance that you can provide through bean provider/Spring-Boot DI, but now it relies on StoveSerde<T, K> interface, hence users can replace it with their ser/de choices. I have written a test to prove the approach is working, take a look, ProtobufSerdeKafkaSystemTest.kt.

Improvements to serialization mechanism:

Enhancements to Kafka testing infrastructure:

Codebase simplifications:

Adresses #560

github-actions[bot] commented 1 day ago

Code Coverage

File Coverage [79.43%] :x:
starters/spring/stove-spring-testing-e2e-kafka/src/main/kotlin/com/trendyol/stove/testing/e2e/kafka/Extensions.kt 100.00% :white_check_mark:
starters/spring/stove-spring-testing-e2e-kafka/src/main/kotlin/com/trendyol/stove/testing/e2e/kafka/KafkaSystem.kt 77.14% :x:
starters/spring/stove-spring-testing-e2e-kafka/src/main/kotlin/com/trendyol/stove/testing/e2e/kafka/MessageStore.kt 71.43% :x:
starters/spring/stove-spring-testing-e2e-kafka/src/main/kotlin/com/trendyol/stove/testing/e2e/kafka/Options.kt 93.33% :white_check_mark:
starters/spring/stove-spring-testing-e2e-kafka/src/main/kotlin/com/trendyol/stove/testing/e2e/kafka/StoveMessage.kt 44.00% :x:
starters/spring/stove-spring-testing-e2e-kafka/src/main/kotlin/com/trendyol/stove/testing/e2e/kafka/TestSystemInterceptor.kt 91.89% :white_check_mark:
Total Project Coverage 71.41% :x:
codecov[bot] commented 1 day ago

Codecov Report

Attention: Patch coverage is 59.85915% with 57 lines in your changes missing coverage. Please review.

Project coverage is 82.21%. Comparing base (2043ba4) to head (9858527). Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...m/trendyol/stove/testing/e2e/kafka/StoveMessage.kt 33.33% 28 Missing :warning:
...om/trendyol/stove/testing/e2e/kafka/KafkaSystem.kt 63.46% 17 Missing and 2 partials :warning:
...l/stove/testing/e2e/kafka/TestSystemInterceptor.kt 71.42% 3 Missing and 3 partials :warning:
...com/trendyol/stove/testing/e2e/kafka/Extensions.kt 86.66% 0 Missing and 2 partials :warning:
...m/trendyol/stove/testing/e2e/kafka/MessageStore.kt 66.66% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #658 +/- ## ========================================== - Coverage 83.14% 82.21% -0.93% ========================================== Files 85 85 Lines 2462 2508 +46 Branches 143 161 +18 ========================================== + Hits 2047 2062 +15 - Misses 316 346 +30 - Partials 99 100 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.