Some minor reorganisation of the tests (ultimately to better contain ElasticSearch code):
Use JUnit 5 TempDirs for the temporary test database. This resolves the occasional failure when a test was aborted and makes sure that test really run on clean data.
Move functions from Server that are only used in tests into a derived class inside the test directory. Also fixes setup of shards. They must only be set when creating the index, not when updating.
Make getById return a PhotonResult instead of a ES-specific GetResponse. For some reason, the result for GetResponse is a completely different type than search, so it needs its own PhotonResult wrapper. This is a crippled version that only implements the functions needed by the tests.
Also adds some tests for ElasticResult and fixed some minor issues the tests uncovered.
Some minor reorganisation of the tests (ultimately to better contain ElasticSearch code):
getById
return a PhotonResult instead of a ES-specific GetResponse. For some reason, the result for GetResponse is a completely different type than search, so it needs its own PhotonResult wrapper. This is a crippled version that only implements the functions needed by the tests.Also adds some tests for ElasticResult and fixed some minor issues the tests uncovered.