Class: FakeConfluentSchemaRegistryServer

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/avro_turf/test/fake_confluent_schema_registry_server.rb

Constant Summary collapse

QUALIFIED_SUBJECT =
/
  :(?<context>\.[^:]*)
  :(?<subject>.*)
/x
DEFAULT_CONTEXT =
'.'
SUBJECTS =
Hash.new { |hash, key| hash[key] = Hash.new { Array.new } }
SCHEMAS =
Hash.new { |hash, key| hash[key] = Array.new }
CONFIGS =
Hash.new
SUBJECT_NOT_FOUND =
{ error_code: 40401, message: 'Subject not found' }.to_json.freeze
VERSION_NOT_FOUND =
{ error_code: 40402, message: 'Version not found' }.to_json.freeze
SCHEMA_NOT_FOUND =
{ error_code: 40403, message: 'Schema not found' }.to_json.freeze
DEFAULT_GLOBAL_CONFIG =
{ 'compatibility' => 'BACKWARD'.freeze }.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.global_configObject (readonly)

Returns the value of attribute global_config.



20
21
22
# File 'lib/avro_turf/test/fake_confluent_schema_registry_server.rb', line 20

def global_config
  @global_config
end

Class Method Details

.clearObject



162
163
164
165
166
167
# File 'lib/avro_turf/test/fake_confluent_schema_registry_server.rb', line 162

def self.clear
  SUBJECTS.clear
  SCHEMAS.clear
  CONFIGS.clear
  @global_config = DEFAULT_GLOBAL_CONFIG.dup
end