com.decathlon.tzatziki.kafka.SchemaRegistry Maven / Gradle / Ivy
package com.decathlon.tzatziki.kafka;
import com.decathlon.tzatziki.utils.Comparison;
import com.decathlon.tzatziki.utils.Mapper;
import io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient;
import org.apache.avro.Schema;
import java.util.Map;
import static com.decathlon.tzatziki.utils.MockFaster.when;
import static org.mockserver.model.HttpRequest.request;
import static org.mockserver.model.HttpResponse.response;
public class SchemaRegistry {
private static final MockSchemaRegistryClient CLIENT = new MockSchemaRegistryClient();
public static String endpoint = "/schemaRegistry/";
public static void initialize() {
CLIENT.reset();
when(request(endpoint + "subjects/.+/versions").withMethod("POST"), Comparison.CONTAINS)
.respond(req -> {
String subject = req.getPath().toString().replaceAll(endpoint + "subjects/(.+)/versions", "$1");
Schema schema = new Schema.Parser().parse(Mapper.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy