DT-2531: Migrate translate usages from UseRestrictionConverter to OntologyService#2815
DT-2531: Migrate translate usages from UseRestrictionConverter to OntologyService#2815
Conversation
|
| return dataUse; | ||
| } | ||
|
|
||
| public String translateDataUse(DataUse dataUse, DataUseTranslationType type) { |
There was a problem hiding this comment.
This is the meat of the change. All services that called this method now call the newer version in OntologyService
There was a problem hiding this comment.
Pull request overview
This PR completes the migration of data use translation functionality by removing the translateDataUse method from UseRestrictionConverter and replacing all its usages with OntologyService.translateDataUse(). This follows up on PR #2811, which replicated the translate feature from the external Ontology service to internal Consent code.
Changes:
- Removed
translateDataUsemethod fromUseRestrictionConverterand simplified its constructor - Updated
VoteServiceto useOntologyServiceinstead ofUseRestrictionConverterfor translation - Updated
DataAccessReportsParserto useOntologyServicefor translation while retainingUseRestrictionConverterfor parsing - Updated all test files to reflect the new dependencies and removed obsolete translation tests
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/org/broadinstitute/consent/http/service/UseRestrictionConverter.java |
Removed translateDataUse method and related dependencies; simplified constructor to no-arg |
src/main/java/org/broadinstitute/consent/http/service/VoteService.java |
Replaced useRestrictionConverter dependency with ontologyService for data use translation |
src/main/java/org/broadinstitute/consent/http/service/DataAccessReportsParser.java |
Added ontologyService dependency and updated translation call while keeping useRestrictionConverter for parsing |
src/main/java/org/broadinstitute/consent/http/ConsentModule.java |
Updated provider methods to reflect simplified UseRestrictionConverter constructor and added ontologyService to VoteService |
src/test/java/org/broadinstitute/consent/http/service/UseRestrictionConverterTest.java |
Removed translation-related tests and updated all test instantiations to use no-arg constructor |
src/test/java/org/broadinstitute/consent/http/service/VoteServiceTest.java |
Updated mock dependencies to replace useRestrictionConverter with ontologyService |
src/test/java/org/broadinstitute/consent/http/service/DataAccessReportsParserTest.java |
Added ontologyService mock and updated test setup to mock translation method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



Addresses
Follow up work for https://broadworkbench.atlassian.net/browse/DT-2531
Summary
This is follow up work to #2811. In that PR, we replicated the translate feature. Unfortunately, I missed one of the usages which was in
UseRestrictionConverterwhich called the same remote endpoint. This PR removes that and replaces all usages with the same method inOntologyService.Have you read CONTRIBUTING.md lately? If not, do that first.