Migration Notes¶
From 0.14.x to 0.15.x¶
Breaking Changes¶
The most notable breaking change is ser/de operations. The framework was only relying on Jackson for serialization and
deserialization. Now, it provides a way to use other serialization libraries. StoveSerde<TIn, TOut>
is the new interface
that you can implement to provide your own serialization and deserialization logic.
StoveSerde
also provides the access to the other serializers that com-trendyol:stove-testing-e2e
package has.
- Jackson
- Gson
- Kotlinx
Also look at ser/de section: Serialization and Deserialization
Spring Kafka (com-trendyol:stove-spring-testing-e2e-kafka)¶
The TestSystemKafkaInterceptor
now depends on StoveSerde
to provide the serialization and deserialization logic instead of ObjectMapper
.
You can of course use your default Jackson implementation by providing the ObjectMapperConfig.default()
to the StoveSerde.jackson.anyByteArraySerde
function.
class TestSystemInitializer : BaseApplicationContextInitializer({
bean<TestSystemKafkaInterceptor<*, *>>(isPrimary = true)
bean { StoveSerde.jackson.anyByteArraySerde(ObjectMapperConfig.default()) } // or any other serde that is <Any, ByteArray>
})
Standalone Kafka¶
kafka {
KafkaSystemOptions(
serde = StoveSerde.jackson.anyByteArraySerde(ObjectMapperConfig.default) // or any other serde that is <Any, ByteArray>
//...
)
}
Couchbase¶
couchbase {
CouchbaseSystemOptions(
clusterSerDe = JacksonJsonSerializer(CouchbaseConfiguration.objectMapper), // here you can provide your own serde
//...
)
}
Http¶
httpClient {
HttpClientSystemOptions(
baseUrl = "http://localhost:8001",
contentConverter = JacksonConverter(ObjectMapperConfig.default)
)
}
Wiremock¶
wiremock {
WireMockSystemOptions(
port = 9090,
serde = StoveSerde.jackson.anyByteArraySerde(ObjectMapperConfiguration.default)
)
Elasticsearch¶
elasticsearch {
ElasticsearchSystemOptions(
jsonpMapper = JacksonJsonpMapper(StoveSerde.jackson.default), // or any JsonpMapper
)
}
Mongodb¶
mongodb {
MongoDbSystemOptions(
serde = StoveSerde.jackson.default // or any other serde that you implement
)
}
The default serde is: