Clean up unit tests for TestDrillSideways [LUCENE-10044]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
All unit tests in `TestDrillSideways` currently do the same task for priming a `DrillDownQuery` and a `DrillSidewaysResult`. I would like to extract the common code here for the initialisation and capture it in `DrillSidewaysInitialiser` - a helper class for writing unit tests which would initialise a `DrillSidewaysResult` while retaining members like `FacetsConfig` for future access.
Something similar has been implemented for `Document` creation in `DocHelper`.
---
Migrated from [LUCENE-10044](https://issues.apache.org/jira/browse/LUCENE-10044) by Sejal Pawar (@sejal-pawar)
Contributor guide
Research direction
Start by reading the unit tests in TestDrillSideways and compare their repeated initialization of DrillDownQuery and DrillSidewaysResult. Review DocHelper for the existing Document-creation pattern, then extract the shared setup into DrillSidewaysInitialiser while retaining members such as FacetsConfig for later access. Done means the duplicated setup is centralized without changing test behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100