A Java application built using the Spring Boot framework. It serves as a REST API that interacts with the JSONPlaceholder API, retrieving and processing data about posts.
The application fetches a list of posts from the JSONPlaceholder API, analyzes them, and provides various functionalities, including displaying all posts, finding the post with the longest title, and modifying the JSON response format to include the length of each post's title.
Additionally, the application is equipped with unit tests to ensure the reliability and correctness of its features. Overall, the Coding Exercise demonstrates the implementation of a Spring Boot REST API for data retrieval and manipulation.
Java JDK (version 17 or higher) Maven (version 3.2.4 or higher)
-
Clone the repository
-
Navigate to the project directory
-
Build and Run the project using:
./mvnw spring-boot:runAlternatively you can use
./mvnw clean package
- To get all posts:
http://localhost:8080/posts - To get the post with the longest title:
http://localhost:8080/longestTitle - To get all post with a new field titleLength:
http://localhost:8080/postsTitleLength
Output Screenshots
- Display all posts
- Display the post with the longest title
- Display all post with a new field titleLength
- Unit test result for the API Controller




