-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notes about refactoring OAI exports for testability.
This needs some sophisticated refactoring to be ready for unit tests.
- Loading branch information
1 parent
a7cc7b8
commit 81fbffe
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81fbffe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense overall, I think.
I'm not sure about moving the exportAllDatasets() method from DatasetServiceBean to the OAIRecordServiceBean though... Metadata exports is something we want to always be doing, even if the OAI server is disabled, and there are no OAI sets or records... So logically this probably belongs in the dataset service bean.
Making these things unit-testable would be nice; but I feel it would make more sense to handle it separately - that is, not in the same PR as #5371.
81fbffe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About moving from DatasetServiceBean: the function
OAIRecordServiceBean.exportAllFormats()
is called fromDatasetServiceBean.exportAllDatasets()
anyway and does the heavy lifting on the selected datasets.The Bean is created anyway, even if OAI is disabled. The timers go off and exports happen, no checks to be found if OAI is enabled or not. The call chain is as follows: Timer ->
DatasetServiceBean.exportAll()
->DatasetServiceBean.exportAllDatasets()
->OAIRecordServiceBean.exportAllFormatsInNewTransaction()
->ExportService.exportAllFormats()
.IMHO it makes more sense to use
DatasetServiceBean
in theOAIRecordServiceBean
to receive (mockable) the datasets that need to be exported and work on those.About unit testing and refactoring for it: alright. This will PR will contain no tests then, but the TODO comments.