Closed shuttie closed 2 years ago
thank you for your action
sometimes we need to configure it by public void configScheme(int size, AbstractOperation... operation) {
,
So we can't initialize it in the constructor.
i add
if (schema != null) schema.close();
And add an assertion
Assert.isTrue(this.schema == null, "Server is running, you can not modify it, please invoke it before `getSchema`");
While playing with redis-mock example code from readme, I've found that RedisServer throws NPE on
close()
call when schema is not set.To reproduce:
which makes a loud blast:
Although this code is not triggering the NPE:
Looks like that schema is null by default when nobody set something custom with
setSchema
. In this PR we init theschema
variable with the default value, as magicalgetSchema
does. There is also a reproducer test added in the test suite.