use of io.confluent.kafka.schemaregistry.id.IncrementalIdGenerator in project schema-registry by confluentinc.
the class KafkaStoreTest method testKafkaStoreMessageHandlerDeleteSubjectKeyNullValue.
// Test no NPE happens when handling DeleteSubjectKey with null value
@Test
public void testKafkaStoreMessageHandlerDeleteSubjectKeyNullValue() throws Exception {
Properties props = new Properties();
props.put(SchemaRegistryConfig.KAFKASTORE_BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
props.put(SchemaRegistryConfig.KAFKASTORE_TOPIC_CONFIG, ClusterTestHarness.KAFKASTORE_TOPIC);
SchemaRegistryConfig config = new SchemaRegistryConfig(props);
KafkaSchemaRegistry schemaRegistry = new KafkaSchemaRegistry(config, new SchemaRegistrySerializer());
InMemoryCache<SchemaRegistryKey, SchemaRegistryValue> store = new InMemoryCache<>(new SchemaRegistrySerializer());
store.init();
KafkaStoreMessageHandler storeMessageHandler = new KafkaStoreMessageHandler(schemaRegistry, store, new IncrementalIdGenerator(schemaRegistry));
storeMessageHandler.handleUpdate(new DeleteSubjectKey("test"), null, null, null, 0L, 0L);
}
use of io.confluent.kafka.schemaregistry.id.IncrementalIdGenerator in project schema-registry by confluentinc.
the class KafkaSchemaRegistry method identityGenerator.
protected IdGenerator identityGenerator(SchemaRegistryConfig config) {
config.checkBootstrapServers();
IdGenerator idGenerator = new IncrementalIdGenerator(this);
idGenerator.configure(config);
return idGenerator;
}
use of io.confluent.kafka.schemaregistry.id.IncrementalIdGenerator in project schema-registry by confluentinc.
the class KafkaStoreTest method testKafkaStoreMessageHandlerClearSubjectKeyNullValue.
// Test no NPE happens when handling ClearSubjectKey with null value
@Test
public void testKafkaStoreMessageHandlerClearSubjectKeyNullValue() throws Exception {
Properties props = new Properties();
props.put(SchemaRegistryConfig.KAFKASTORE_BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
props.put(SchemaRegistryConfig.KAFKASTORE_TOPIC_CONFIG, ClusterTestHarness.KAFKASTORE_TOPIC);
SchemaRegistryConfig config = new SchemaRegistryConfig(props);
KafkaSchemaRegistry schemaRegistry = new KafkaSchemaRegistry(config, new SchemaRegistrySerializer());
InMemoryCache<SchemaRegistryKey, SchemaRegistryValue> store = new InMemoryCache<>(new SchemaRegistrySerializer());
store.init();
KafkaStoreMessageHandler storeMessageHandler = new KafkaStoreMessageHandler(schemaRegistry, store, new IncrementalIdGenerator(schemaRegistry));
storeMessageHandler.handleUpdate(new ClearSubjectKey("test"), null, null, null, 0L, 0L);
}
Aggregations