Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SpringBoot ( Debugging ) : Home API Environment Java version: 1 . 8 Maven version: 3 . * Spring Boot version: 2 . 3 .

SpringBoot(Debugging): Home API
Environment
Java version: 1.8
Maven version: 3.*
Spring Boot version: 2.3.4.RELEASE
Data
Example of a Home data JSON object:
{" i d":1, "area": 36.1189, "price": 86.6892,^ prime cit y^ prime prime "Noida"
}
Requirements
In this project, home data are provided for many countries with API endpoints for fetching specific information. Note that all the data are virtual. The following REST endpoints have been implemented and all the endpoints are secured by HTTP basic authentication.
POST request to /api/home:
accepts a home object without id and returns status code 201 on creation
if the home object with id is provided, returns status code 400
it is secured by HTTP basic auth where username and password are 'admin' and 'admin'
GET request to /api/home/{id}:
returns the home entry with the given id and status code 200
returns status code 404 if the requested home does not exist
returns status code 400 if the requested home id is invalid
this should be publicly accessible and should not require HTTP basic authentication
GET request to /api/home:
returns all the home entries with status code 200
it us secured by HTTP basic auth where username and password are 'admin' and 'admin'
There are 5 tests already written but some are failing due to bugs in the implementation of the HTTP basic security configuration. Find the bugs and fix them so that all the tests pass.
Commands
run:
mvn clean spring-boot:run
install:
mvn clean install
test:
mvn clean test
Software Instructions
The question(s) requires Java Development Kit 17.
Install JDK 17 on MacOS
Install JDK 17 on Windows
Install JDK 17 on Linux
Install Maven
Git Instructions
Use the following commands to work with this project
Run
mvn clean spring-boot:run
Test
mvn clean test
Install
mvn clean install

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions