feat: Add dateUpdated field and methods to Post class #22
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.
This pull request introduces several changes to the
com.liatrio.dojo.devopsknowledgeshareapi
package to improve the functionality and test coverage of the application. The most significant changes include the addition of theAuthorController
andAuthorService
classes, updates to thePost
andPostController
classes, and the creation ofAuthorControllerTest
and updates toPostTest
.Additions to the application:
src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/AuthorController.java
: A newAuthorController
class was added to handle HTTP requests related to authors. It includes agetAuthors
method that fetches all authors and returns them with an HTTP status of OK.src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/AuthorService.java
: TheAuthorService
class was added to handle operations related to authors. It includes agetAllAuthors
method that fetches all authors from theAuthorRepository
.Updates to existing classes:
src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/Post.java
: ThePost
class was updated to include adateUpdated
field, along with its corresponding setter and getter methods.src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostController.java
: ThePostController
class was updated to include exception handling in thepost
method and a newputPost
method to update a post given its ID and new details.src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostRepository.java
: ThePostRepository
interface was updated to include methods for finding posts by title, first name, and link.Testing improvements:
src/test/java/com/liatrio/dojo/devopsknowledgeshareapi/AuthorControllerTest.java
: TheAuthorControllerTest
class was added to test thegetAuthors
method in theAuthorController
class.src/test/java/com/liatrio/dojo/devopsknowledgeshareapi/PostTest.java
: ThePostTest
class was updated to include tests for thesetDateUpdated
andgetDateUpdated
methods in thePost
class.