Bläddra i källkod

Update README.md

Git-Leon 7 år sedan
förälder
incheckning
2eaf422e0c
1 ändrade filer med 21 tillägg och 3 borttagningar
  1. 21
    3
      README.md

+ 21
- 3
README.md Visa fil

1
+
2
+
1
 # Part 1 - Domain Implementation<br>
3
 # Part 1 - Domain Implementation<br>
2
 * _Domain objects_ are the backbone for an application and contain the [business logic](https://en.wikipedia.org/wiki/Business_logic).
4
 * _Domain objects_ are the backbone for an application and contain the [business logic](https://en.wikipedia.org/wiki/Business_logic).
3
 * Create a sub package of `java` named `domain`.
5
 * Create a sub package of `java` named `domain`.
232
 # Part 3.1.8 - Test
234
 # Part 3.1.8 - Test
233
 * Restart the QuickPoll application.
235
 * Restart the QuickPoll application.
234
 * Ensure a JSON file with a `status` of `200` is returned by executing a `PUT` request of `http://localhost:8080/polls/1` via Postman
236
 * Ensure a JSON file with a `status` of `200` is returned by executing a `PUT` request of `http://localhost:8080/polls/1` via Postman
235
-
237
+execute a `PUT` request of
238
+
239
+```JSON
240
+{
241
+    "id": 1,
242
+        "question": "What's the best netflix original?",
243
+        "options": [
244
+	    { "id": 1, "value": "Black Mirror" },
245
+	    { "id": 2, "value": "Stranger Things" },
246
+	    { "id": 3, "value": "Orange is the New Black"},
247
+	    { "id": 4, "value": "The Get Down" }
248
+	]
249
+}
250
+```
236
 
251
 
237
 
252
 
238
 -
253
 -
260
 }
275
 }
261
 ```
276
 ```
262
 
277
 
278
+# Part 3.2.1 - Testing `VoteController`
279
+* To test the voting capabilities, `POST` a new Vote to the `/polls/1/votes` endpoint with the option object expressed in `JSON` below.
280
+* On successful request execution, you will see a Location response header with value http://localhost:8080/polls/1/votes/1.
263
 
281
 
264
 
282
 
265
 
283
 
266
 -
284
 -
267
-# Part 3.2.1 - Modify `VoteRepository`
285
+# Part 3.2.2 - Modify `VoteRepository`
268
 * The method `findAll` in the `VoteRepository` retrieves all votes in a Database rather than a given poll.
286
 * The method `findAll` in the `VoteRepository` retrieves all votes in a Database rather than a given poll.
269
 * To ensure we can get votes for a given poll, we must add the code below to our `VoteRepository`.
287
 * To ensure we can get votes for a given poll, we must add the code below to our `VoteRepository`.
270
 
288
 
288
 
306
 
289
 
307
 
290
 -
308
 -
291
-# Part 3.2.2 - Modify `VoteController`
309
+# Part 3.2.3 - Modify `VoteController`
292
 * Create a `getAllVotes` method in the `VoteController`
310
 * Create a `getAllVotes` method in the `VoteController`
293
 
311
 
294
 
312