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

DMP-3396: Implement get audio versions endpoint #2641

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Ben-Edwards-cgi
Copy link
Contributor

Links

Jira

Change description

Summary of Changes in Git Diff

This commit introduces a new integration test for the AudioController, specifically for the endpoint that retrieves media versions by ID. It also updates several Java files to support this new functionality, including the addition of new response models and the corresponding service and controller methods.

Highlights

  • New Integration Test:

    • A new file AudioControllerGetAdminMediaVersionsByIdIntTest.java is created for testing various scenarios of fetching media versions by ID.
    • Tests include:
      • Successfully retrieving current and previous media versions.
      • Handling requests for media IDs that do not exist, resulting in a 404 error.
      • Ensuring proper authorization handling based on security roles.
  • New Response Models:

    • Introduced AdminVersionedMediaResponse and AdminMediaVersionResponse to structure the responses for media version requests.
    • New JSON files for expected responses during tests are added.
  • Controller Enhancements:

    • Modified AudioController.java to include a new endpoint for fetching media versions, with appropriate security annotations.
  • Service Layer Updates:

    • AdminMediaService.java and its implementation are updated to include the logic for retrieving media versions by ID.
    • New methods are added to handle fetching media versions based on the chronicleId.
  • Database Queries:

    • Added a new query in MediaRepository.java to fetch all media entities by chronicleId.
  • OpenAPI Documentation:

    • Updated audio.yaml to include the new endpoint documentation for fetching media versions.
  • Error Handling Improvements:

    • Enhanced error handling in the service layer to address cases when the chronicleId is null for media entities.
  • Unit Tests:

    • Added unit tests for the new functionality in the service and mapper classes to ensure correct behavior.

These changes collectively enhance the functionality of the audio management system by allowing users to retrieve detailed version information for specific media records while ensuring robust error handling and authorization checks.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[X] No

@Ben-Edwards-cgi
Copy link
Contributor Author

This Pr depends on changes in: #2628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants