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

feat: tests and crud functionality for api #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

baserrato
Copy link

This pull request introduces a new AuthorController class, adds methods to the PostController class, and updates the PostRepository interface. Additionally, it includes new test cases for the AuthorController and PostController classes. Below are the most important changes:

New Features:

  • New AuthorController class:

    • Introduced a new AuthorController class with a getAuthors endpoint to return a sample list of authors. (src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/AuthorController.java)
  • New methods in PostController:

    • Added getPostsByTitle, getPostsByFirstName, and getPostsByLink methods to fetch posts based on title, first name, and link respectively. (src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostController.java)
    • Added putPost method to update an existing post by its ID. (src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostController.java)

Repository Updates:

  • Updates to PostRepository:
    • Added new query methods findByTitle, findByFirstName, and findByLink to the PostRepository interface. (src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostRepository.java)

Model Updates:

  • Updates to Post class:
    • Added dateUpdated field along with its getter and setter methods. (src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/Post.java)

Tests:

  • New tests for AuthorController:

    • Added AuthorControllerTest class to test the getAuthors endpoint. (src/test/java/com/liatrio/dojo/devopsknowledgeshareapi/AuthorControllerTest.java)
  • New tests for PostController:

    • Added tests for getPostsByTitle, getPostsByFirstName, and getPostsByLink methods. (src/test/java/com/liatrio/dojo/devopsknowledgeshareapi/PostControllerTest.java)
  • New tests for Post class:

    • Added tests for setDateUpdated and getDateUpdated methods. (src/test/java/com/liatrio/dojo/devopsknowledgeshareapi/PostTest.java)

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

Successfully merging this pull request may close these issues.

1 participant