Gaffer
Gaffer copied to clipboard
Refactor unit tests which use Schemas
Currently there is a lot of repetition in our test classes for the creation and use of schemas - this should be refactored to encourage reuse.
This task should be tackled piecemeal after the implementation of gh-1833.
@t92549 @t511203 Our tests have undergone some changes over the years so is this still relevant? "Currently there is a lot of repetition in our test classes for the creation and use of schemas - this should be refactored to encourage reuse."
@n3101 I think this is still relevant. This kind of relates to a whole load of ideas described in https://github.com/gchq/Gaffer/issues/1833. Ideas which I have been toying with recently and I didn't realise were documented anywhere by someone else. As described, it fits into a piece of work that starts with #1867
An additional problem with use of schemas is that various unit tests in Graph
and Store
make the assumption that the schema used to create a store will be the same as the schema returned by getSchema
when it is actually getOriginalSchema
which is guaranteed to return this. The getOriginalSchema
method only works in combination with a Graph
and remains null
if only a Store
has been created.
Therefore there are unit tests which use mocking to create behaviour which differs from the actual behaviour. This should be fixed as part of any refactor.