Skip to content

CodeDifferently/Maven.SpringDemo-MVCPerson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to use

  • Purpose - To demonstrate use of a very basic MVC Spring project

Part 1 - Running the Program

  1. Begin by cloning this project into your ~/dev directory.
  2. Navigate to the newly cloned project.
  3. Open the project in IntelliJ from the pom.xml
    • When prompted, select Open As Project
  4. 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
      1. the request-type has been set to POST
      2. the request-body has been populated from the Body tab of the interface
      3. 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
      1. the request-type has been set to PUT
      2. the request-body has been populated from the Body tab of the interface
      3. 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"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages