-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.http
More file actions
26 lines (23 loc) · 790 Bytes
/
test_api.http
File metadata and controls
26 lines (23 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
### 1. GET: Kontrollera Streaken (Startvärde)
# Metod: GET (Hämta data)
# Förväntat: 1 (eller 2 om din CommandLineRunner fungerade helt)
GET http://localhost:8080/api/habit/1/streak
Accept: application/json
###
### 2. POST: Logga Vanan Idag (Skapa data)
# Metod: POST (Skapa logg)
# Förväntat: HTTP 200 OK och ny HabitLog i JSON
POST http://localhost:8080/api/habit/1/log
Accept: application/json
###
### 3. GET: Kontrollera Streaken (Efter loggning)
# Metod: GET (Hämta data)
# Förväntat: Streaken ska ha ökat med 1.
GET http://localhost:8080/api/habit/1/streak
Accept: application/json
###
### 4. POST: Dubbelloggning (Validering)
# Metod: POST (Försök skapa logg igen)
# Förväntat: HTTP 400 Bad Request
POST http://localhost:8080/api/habit/1/log
Accept: application/json