MBA-716: Extract Look.java business logic into LookService - #25
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Created new LookService class in gov.uspto.bulkdata.service package - Extracted three core business methods from Look.java: * lookupPatents() - processes multiple patents with limit * lookupPatentById() - looks up specific patent by ID * showPatentFields() - extracts and formats patent fields - Made LookService stateless by passing rawDoc as parameter - Refactored Look.java to use LookService as thin CLI wrapper - Preserved all existing CLI functionality and output format - Added Mockito test dependency to BulkDownloader module - Created comprehensive unit tests in LookServiceTest.java - Created integration tests in LookIntegrationTest.java - All 24 BulkDownloader tests passing This establishes the first service layer in the codebase as part of the microservices architecture conversion. The service interface is designed to be reusable for future REST APIs while maintaining backward compatibility with the existing CLI tool. Co-Authored-By: Jake Cosme <jake@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MBA-716: Extract Look.java business logic into LookService
Summary
This PR refactors the Look.java CLI tool to extract its core business logic into a new
LookServiceclass, establishing the first service layer in the codebase as part of the microservices architecture conversion (parent epic).Key Changes:
LookServiceclass in newgov.uspto.bulkdata.servicepackage with three core methods:lookupPatents()- processes multiple patents with a limitlookupPatentById()- looks up a specific patent by document IDshowPatentFields()- extracts and formats patent fields (private helper)rawDocas a parameter instead of using instance variablesLook.javato useLookServiceas a thin CLI wrapper (removed ~180 lines of business logic)LookServiceTest.java- 6 unit tests covering core service methodsLookIntegrationTest.java- 8 integration tests verifying CLI functionalityBehavior Preservation:
Review & Testing Checklist for Human
lookupPatentByIdwith real patent IDs to ensure the document ID matching works correctly (the tests verify the method runs but don't fully validate ID matching behavior)Recommended Test Plan:
Notes