Giter Site home page Giter Site logo

dat250-spring-counters-todos's Introduction

dat250-spring-counter-todos starter project

The test suite (TodoControllerTest) should run after your implementation (see badge below). You are not allowed to change the test class!

TodoControllerTest

Check the tab Actions in GitHub for more information and to activate the workflow run.

Careful:

  1. The test class sends POST-Request to create TODOs without IDs and expects the single created TODO to return with an ID! See REST API examples PUT and POST below.
  2. Furthermore, if a Todo with a given id should be retrieved, updated, or deleted and it does not exist, the tests expect a specific error message. See GET, PUT, and DELETE.

REST API examples

[
  {
    "id": 1,
    "summary": "Buy food",
    "description": "Buy an egg and ramen"
  },
  {
    "id": 2,
    "summary": "Walk the dog",
    "description": "Walk the dog for 30 minutes"
  },
  {
    "id": 3,
    "summary": "Train",
    "description": "Train weight lifting for five hours"
  }
]
{
  "id": 1,
  "summary": "Buy food",
  "description": "Buy an egg and ramen"
}

If the Todo with the id 999 does not exist.

{
  "timestamp": "2023-10-06T11:52:27.842+00:00",
  "status": 404,
  "error": "Not Found",
  "message": "Todo with the id 999 not found!",
  "path": "/todos/999"
}

Body:

{
  "summary": "Buy food",
  "description": "Buy an egg and ramen"
}

Response:

{
  "id": 1,
  "summary": "Buy food",
  "description": "Buy an egg and ramen"
}

Body:

{
  "summary": "Buy copious amounts of food",
  "description": "Buy two eggs and ramen"
}

Response:

{
  "id": 1,
  "summary": "Buy copious amounts of food",
  "description": "Buy two eggs and ramen"
}

If the Todo with the id 999 does not exist.

Body:

{
  "summary": "Buy copious amounts of food",
  "description": "Buy two eggs and ramen"
}

Response:

{
  "timestamp": "2023-10-06T11:54:55.392+00:00",
  "status": 404,
  "error": "Not Found",
  "message": "Todo with the id 999 not found!",
  "path": "/todos/999"
}
[
  {
    "id": 2,
    "summary": "Walk the dog",
    "description": "Walk the dog for 30 minutes"
  },
  {
    "id": 3,
    "summary": "Train",
    "description": "Train weight lifting for five hours"
  }
]

If the Todo with the id 999 does not exist.

{
  "timestamp": "2023-10-06T11:56:29.114+00:00",
  "status": 404,
  "error": "Not Found",
  "message": "Todo with the id 999 not found!",
  "path": "/todos/999"
}

dat250-spring-counters-todos's People

Contributors

timkraeuter avatar

Watchers

Lars Michael Kristensen avatar Volker Stolz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.