However, reset! will also blow away all producer and consumer configs. This is not what we want to happen. We should introduce a new method, as_unit_test that uses Deimos.with_config instead, e.g.
Deimos.with_config(
'logger' => Logger.new(STDOUT),
'consumers.reraise_errors' => true,
'kafka.seed_brokers' => ['test_broker'],
'schema.backend' => Deimos.schema_backend_class.mock_backend,
'producers.backend' => :test
) do
yield
end
The approach suggested by the documentation is as follows:
However,
reset!
will also blow away all producer and consumer configs. This is not what we want to happen. We should introduce a new method,as_unit_test
that usesDeimos.with_config
instead, e.g.