Skip to content

Commit

Permalink
getRequests: removed unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyZ1435 committed Oct 28, 2022
1 parent c54f3b6 commit dcdf8e8
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions src/test/java/ca/utoronto/utm/mcs/AppTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,28 +135,18 @@ public void getMoviePass() throws JSONException, IOException, InterruptedExcepti
JSONObject setupReq = new JSONObject()
.put("name", "TestMovie")
.put("movieId", "12345678901");
HttpResponse<String> setupRes = sendRequest("/api/v1/addMovie", "PUT", setupReq.toString());
sendRequest("/api/v1/addMovie", "PUT", setupReq.toString());

JSONObject confirmReq = new JSONObject()
.put("movieId", "12345678901");
HttpResponse<String> confirmRes = sendRequest("/api/v1/getMovie", "GET", confirmReq.toString());

JSONObject deleteReq = new JSONObject()
.put("movieId", "12345678901");
HttpResponse<String> deleteRes = sendRequest("/api/v1/deleteMovie", "DELETE", confirmReq.toString());
sendRequest("/api/v1/deleteMovie", "DELETE", confirmReq.toString());
assertEquals(HttpURLConnection.HTTP_OK, confirmRes.statusCode());
}

@Test
public void getMovieFail() throws JSONException, IOException, InterruptedException {
<<<<<<< HEAD
=======
JSONObject setupReq = new JSONObject()
.put("name", "TestMovie")
.put("movieId", "12345678901");
sendRequest("/api/v1/addMovie", "PUT", setupReq.toString());

>>>>>>> 754fda16e642d645134f6af8558d3f96d4cfca5c
JSONObject confirmReq = new JSONObject()
.put("name", "TestMovie");
HttpResponse<String> confirmRes = sendRequest("/api/v1/getMovie", "GET", confirmReq.toString());
Expand All @@ -169,29 +159,25 @@ public void hasRelationshipPass() throws JSONException, IOException, Interrupted
JSONObject setupReq = new JSONObject()
.put("name", "TestMovie")
.put("movieId", "12345678901");
HttpResponse<String> setupRes = sendRequest("/api/v1/addMovie", "PUT", setupReq.toString());
sendRequest("/api/v1/addMovie", "PUT", setupReq.toString());

setupReq = new JSONObject()
setupReq = new JSONObject()
.put("name", "TestActor")
.put("actorId", "12345678902");
setupRes = sendRequest("/api/v1/addActor", "PUT", setupReq.toString());
sendRequest("/api/v1/addActor", "PUT", setupReq.toString());

setupReq = new JSONObject()
.put("movieId", "12345678901")
.put("actorId", "12345678902");
setupRes = sendRequest("/api/v1/addRelationship", "PUT", setupReq.toString());
sendRequest("/api/v1/addRelationship", "PUT", setupReq.toString());

JSONObject confirmReq = new JSONObject()
.put("movieId", "12345678901")
.put("actorId", "12345678902");
HttpResponse<String> confirmRes = sendRequest("/api/v1/hasRelationship", "GET", confirmReq.toString());

JSONObject deleteReq = new JSONObject()
.put("movieId", "12345678901");
HttpResponse<String> deleteRes = sendRequest("/api/v1/deleteMovie", "DELETE", confirmReq.toString());
deleteReq = new JSONObject()
.put("actorId", "12345678902");
deleteRes = sendRequest("/api/v1/deleteActor", "DELETE", confirmReq.toString());
sendRequest("/api/v1/deleteMovie", "DELETE", confirmReq.toString());
sendRequest("/api/v1/deleteActor", "DELETE", confirmReq.toString());
assertEquals(HttpURLConnection.HTTP_OK, confirmRes.statusCode());
}

Expand Down

0 comments on commit dcdf8e8

Please sign in to comment.