Skip to content

Commit 7c3d1ec

Browse files
committed
Test: Updated default schema registry compatibilty
1 parent be9b6d8 commit 7c3d1ec

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

src/integrationTest/java/com/mongodb/kafka/connect/embedded/EmbeddedKafka.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class EmbeddedKafka implements BeforeAllCallback, AfterEachCallback, Afte
6262
private static final Logger LOGGER = LoggerFactory.getLogger(EmbeddedKafka.class);
6363
private static final int DEFAULT_BROKER_PORT = 0; // 0 results in a random port being selected
6464
private static final String KAFKA_SCHEMAS_TOPIC = "_schemas";
65-
private static final String AVRO_COMPATIBILITY_TYPE = "NONE";
65+
private static final String COMPATIBILITY_LEVEL = "BACKWARD";
6666

6767
private static final String KAFKASTORE_OPERATION_TIMEOUT_MS = "10000";
6868
private static final String KAFKASTORE_DEBUG = "true";
@@ -198,11 +198,7 @@ public void start() throws Exception {
198198

199199
schemaRegistry =
200200
new RestApp(
201-
0,
202-
zookeeperConnect(),
203-
KAFKA_SCHEMAS_TOPIC,
204-
AVRO_COMPATIBILITY_TYPE,
205-
schemaRegistryProps);
201+
zookeeperConnect(), KAFKA_SCHEMAS_TOPIC, COMPATIBILITY_LEVEL, schemaRegistryProps);
206202
schemaRegistry.start();
207203

208204
LOGGER.debug("Starting a Connect standalone instance...");

src/integrationTest/java/com/mongodb/kafka/connect/embedded/RestApp.java

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import java.util.Properties;
2121

22-
import io.confluent.kafka.schemaregistry.avro.AvroCompatibilityLevel;
22+
import io.confluent.kafka.schemaregistry.CompatibilityLevel;
2323
import io.confluent.kafka.schemaregistry.client.rest.RestService;
2424
import io.confluent.kafka.schemaregistry.exceptions.SchemaRegistryException;
2525
import io.confluent.kafka.schemaregistry.rest.SchemaRegistryConfig;
@@ -37,38 +37,28 @@ public class RestApp {
3737
public Server restServer;
3838
public String restConnect;
3939

40-
public RestApp(int port, String zkConnect, String kafkaTopic) {
41-
this(port, zkConnect, kafkaTopic, AvroCompatibilityLevel.NONE.name, null);
40+
public RestApp(String zkConnect, String kafkaTopic) {
41+
this(zkConnect, kafkaTopic, CompatibilityLevel.NONE.name, null);
4242
}
4343

4444
public RestApp(
45-
int port,
4645
String zkConnect,
4746
String kafkaTopic,
4847
String compatibilityType,
4948
Properties schemaRegistryProps) {
50-
this(port, zkConnect, null, kafkaTopic, compatibilityType, true, schemaRegistryProps);
49+
this(zkConnect, null, kafkaTopic, compatibilityType, true, schemaRegistryProps);
5150
}
5251

5352
public RestApp(
54-
int port,
5553
String zkConnect,
5654
String kafkaTopic,
5755
String compatibilityType,
5856
boolean masterEligibility,
5957
Properties schemaRegistryProps) {
60-
this(
61-
port,
62-
zkConnect,
63-
null,
64-
kafkaTopic,
65-
compatibilityType,
66-
masterEligibility,
67-
schemaRegistryProps);
58+
this(zkConnect, null, kafkaTopic, compatibilityType, masterEligibility, schemaRegistryProps);
6859
}
6960

7061
public RestApp(
71-
int port,
7262
String zkConnect,
7363
String bootstrapBrokers,
7464
String kafkaTopic,
@@ -79,15 +69,14 @@ public RestApp(
7969
if (schemaRegistryProps != null) {
8070
prop.putAll(schemaRegistryProps);
8171
}
82-
prop.setProperty(SchemaRegistryConfig.PORT_CONFIG, ((Integer) port).toString());
8372
if (zkConnect != null) {
8473
prop.setProperty(SchemaRegistryConfig.KAFKASTORE_CONNECTION_URL_CONFIG, zkConnect);
8574
}
8675
if (bootstrapBrokers != null) {
8776
prop.setProperty(SchemaRegistryConfig.KAFKASTORE_BOOTSTRAP_SERVERS_CONFIG, bootstrapBrokers);
8877
}
8978
prop.put(SchemaRegistryConfig.KAFKASTORE_TOPIC_CONFIG, kafkaTopic);
90-
prop.put(SchemaRegistryConfig.COMPATIBILITY_CONFIG, compatibilityType);
79+
prop.put(SchemaRegistryConfig.SCHEMA_COMPATIBILITY_CONFIG, compatibilityType);
9180
prop.put(SchemaRegistryConfig.MASTER_ELIGIBILITY, masterEligibility);
9281
}
9382

0 commit comments

Comments
 (0)