diff --git a/src/test/java/ca/utoronto/utm/mcs/AppTest.java b/src/test/java/ca/utoronto/utm/mcs/AppTest.java index 4e864bf..dfc704e 100644 --- a/src/test/java/ca/utoronto/utm/mcs/AppTest.java +++ b/src/test/java/ca/utoronto/utm/mcs/AppTest.java @@ -135,28 +135,18 @@ public void getMoviePass() throws JSONException, IOException, InterruptedExcepti JSONObject setupReq = new JSONObject() .put("name", "TestMovie") .put("movieId", "12345678901"); - HttpResponse setupRes = sendRequest("/api/v1/addMovie", "PUT", setupReq.toString()); + sendRequest("/api/v1/addMovie", "PUT", setupReq.toString()); JSONObject confirmReq = new JSONObject() .put("movieId", "12345678901"); HttpResponse confirmRes = sendRequest("/api/v1/getMovie", "GET", confirmReq.toString()); - JSONObject deleteReq = new JSONObject() - .put("movieId", "12345678901"); - HttpResponse 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 confirmRes = sendRequest("/api/v1/getMovie", "GET", confirmReq.toString()); @@ -169,29 +159,25 @@ public void hasRelationshipPass() throws JSONException, IOException, Interrupted JSONObject setupReq = new JSONObject() .put("name", "TestMovie") .put("movieId", "12345678901"); - HttpResponse 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 confirmRes = sendRequest("/api/v1/hasRelationship", "GET", confirmReq.toString()); - JSONObject deleteReq = new JSONObject() - .put("movieId", "12345678901"); - HttpResponse 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()); }