Purpose - To demonstrate use of a very basic MVC Spring project
Part 1 - Running the Program
Begin by cloning this project into your ~/dev directory.
Navigate to the newly cloned project.
Open the project in IntelliJ from the pom.xml
When prompted, select Open As Project
Run the MainApplication to begin exposing endpoints for a client to make requests to.
Part 2 - Viewing All PersonRepository Contents
From Postman, make a get request to localhost:8080/person/readAll.
An empty list should return
Part 3 - Creating a Person
From Postman, make a post request to localhost:8080/person/create using the JSON body displayed below.
to make a post request, ensure
the request-type has been set to POST
the request-body has been populated from the Body tab of the interface
the request-data has been set to JSON (application/json)
From Postman, make a get request to localhost:8080/person/readAll to verify that the person has been added.
{
"id" : 1 ,
"firstName" : " John" ,
"lastName" : " Smith" ,
"age" : 30
}
Part 4 - Updating a Person
From Postman, make a put request to localhost:8080/person/update using the JSON body displayed below.
to make a put request, ensure
the request-type has been set to PUT
the request-body has been populated from the Body tab of the interface
the request-data has been set to JSON (application/json)
From Postman, make a get request to localhost:8080/person/readAll to verify that the person has been modified.
{
"id" : 1 ,
"firstName" : " Johnson" ,
"lastName" : " Smithson" ,
"age" : 30
}
Part 5 - Reading a Person by ID
From Postman, make a get request to localhost:8080/person/read/1.
ensure that a single object is returned rather than a list.
ensure that the field-values of the returned Person object corresponds to the values set in Part 4.
Part 6 - Deleting a Person
From Postman, make a delete request to localhost:8080/person/delete/1
From Postman, make a get request to localhost:8080/person/read/1.
ensure that the object has been deleted
The following response is an example of what should be visible
{
"timestamp" : " 2019-08-02T18:42:59.829+0000" ,
"status" : 500 ,
"error" : " Internal Server Error" ,
"message" : " No value present" ,
"path" : " /person/read/1"
}