Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code coverage up to 95% #9

Merged
merged 2 commits into from
Nov 7, 2024
Merged

Conversation

jp-tosca
Copy link
Collaborator

@jp-tosca jp-tosca commented Nov 7, 2024

This pull request includes a series of changes to the edu.harvard.iq.dataverse_hub project, focusing on code refactoring, the addition of unit tests, and the renaming of test files for better organization. The most important changes are summarized below:

Code Refactoring:

  • Renamed fields in AccessToken from token_id to tokenId and user_id to userId, and added getter and setter methods, along with toString and equals methods. (src/main/java/edu/harvard/iq/dataverse_hub/model/AccessToken.java)
  • Updated AccessTokenRepo to use the new field names in the query. (src/main/java/edu/harvard/iq/dataverse_hub/repository/AccessTokenRepo.java)
  • Removed the isGdccMember method from Installation.java and replaced it with getGdccMember. (src/main/java/edu/harvard/iq/dataverse_hub/model/Installation.java)
  • Removed an unused method findByDVHubId from InstallationService.java. (src/main/java/edu/harvard/iq/dataverse_hub/service/InstallationService.java)
  • Added null check in UserService.validateRequest method to handle null requests. (src/main/java/edu/harvard/iq/dataverse_hub/service/UserService.java)

Addition of Unit Tests:

  • Added unit tests for various classes including ServerMessageResponse, ErrorResponseController, InstallationController, OpenAPIController, AccessToken, InstallationDao, ScheduledJob, VersionInfoDao, TokenAuthFilter, and InstallationService. (Multiple files)

Renaming of Test Files:

  • Renamed several test files to better reflect their purpose and location within the project:
    • InstallationGitImporterTests.java to scheduled/InstallationGitImporterTests.java
    • VersionDVInstallationCheckTests.java to scheduled/VersionDVInstallationCheckTests.java
    • RestHelperServiceTests.java to service/RestHelperServiceTests.java
    • ScheduledJobServiceTests.java to service/ScheduledJobServiceTests.java

…pdate RestHelperServiceTests to correct URL; add unit tests for InstallationDao and VersionInfoDao.
…okenRepo query method; validate request in UserService; implement equals method in ScheduledJob; remove unused ScheduledJobServiceTests.
@jp-tosca jp-tosca added enhancement New feature or request Size: 10 FY25 Sprint 10 FY25 Sprint 10 (2024-11-06 - 2024-11-20) labels Nov 7, 2024
@jp-tosca jp-tosca self-assigned this Nov 7, 2024
@jp-tosca jp-tosca merged commit 737d8ba into main Nov 7, 2024
@jp-tosca jp-tosca deleted the code-coverage-demo-improvements-2 branch November 8, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request FY25 Sprint 10 FY25 Sprint 10 (2024-11-06 - 2024-11-20) Size: 10
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

1 participant