diff --git a/constructorio-client/src/test/java/io/constructor/client/ConstructorIOQuizNextQuestionTest.java b/constructorio-client/src/test/java/io/constructor/client/ConstructorIOQuizNextQuestionTest.java index 58a5ca33..8b9ec49e 100644 --- a/constructorio-client/src/test/java/io/constructor/client/ConstructorIOQuizNextQuestionTest.java +++ b/constructorio-client/src/test/java/io/constructor/client/ConstructorIOQuizNextQuestionTest.java @@ -153,6 +153,7 @@ public void QuizQuestionAsJsonShouldReturnErrorWithInvalidIndexKey() throws Exce public void QuizQuestionShouldReturnResultWithAnswersParameter() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(validAnswers); QuizQuestionResponse response = constructor.quizNextQuestion(request, null); @@ -164,6 +165,7 @@ public void QuizQuestionShouldReturnResultWithAnswersParameter() throws Exceptio public void QuizQuestionAsJsonShouldReturnResultWithAnswersParameter() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(validAnswers); String response = constructor.quizNextQuestionAsJson(request, null); JSONObject jsonObject = new JSONObject(response); @@ -179,6 +181,7 @@ public void QuizQuestionAsJsonShouldReturnResultWithAnswersParameter() throws Ex public void QuizQuestionShouldReturnResultWithAllAnswerTypes() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(finalAnswers); QuizQuestionResponse response = constructor.quizNextQuestion(request, null); @@ -190,6 +193,7 @@ public void QuizQuestionShouldReturnResultWithAllAnswerTypes() throws Exception public void QuizQuestionAsJsonShouldReturnResultWithAllAnswerTypes() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(finalAnswers); String response = constructor.quizNextQuestionAsJson(request, null); JSONObject jsonObject = new JSONObject(response); diff --git a/constructorio-client/src/test/java/io/constructor/client/ConstructorIOQuizResultsTest.java b/constructorio-client/src/test/java/io/constructor/client/ConstructorIOQuizResultsTest.java index 0da821bd..c1e56b8f 100644 --- a/constructorio-client/src/test/java/io/constructor/client/ConstructorIOQuizResultsTest.java +++ b/constructorio-client/src/test/java/io/constructor/client/ConstructorIOQuizResultsTest.java @@ -57,6 +57,7 @@ public void QuizResultsAsJSONShouldErrorWithoutAnswersParameter() throws Excepti public void QuizResultsShouldReturnResultWithAnswersParameter() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(validAnswers); QuizResultsResponse response = constructor.quizResults(request, null); @@ -71,6 +72,7 @@ public void QuizResultsShouldReturnResultWithAnswersParameter() throws Exception public void QuizResultsAsJsonShouldReturnResultWithAnswersParameter() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(validAnswers); String response = constructor.quizResultsAsJson(request, null); JSONObject jsonObject = new JSONObject(response); @@ -86,6 +88,7 @@ public void QuizResultsAsJsonShouldReturnResultWithAnswersParameter() throws Exc public void QuizResultsShouldReturnResultWithVersionIdAndSessionId() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest initialRequest = new QuizRequest(quizId); + initialRequest.setQuizSessionId(quizSessionId); initialRequest.setAnswers(validAnswers); QuizResultsResponse initialResponse = constructor.quizResults(initialRequest, null); @@ -126,6 +129,7 @@ public void QuizResultsShouldReturnAResultWithResultSources() throws Exception { public void QuizResultsAsJsonShouldReturnResultWithVersionIdAndSessionid() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest initialRequest = new QuizRequest(quizId); + initialRequest.setQuizSessionId(quizSessionId); initialRequest.setAnswers(validAnswers); QuizResultsResponse initialResponse = constructor.quizResults(initialRequest, null); @@ -149,6 +153,7 @@ public void QuizResultsAsJsonShouldReturnResultWithVersionIdAndSessionid() throw public void QuizResultsShouldReturnResultWithAllAnswerTypes() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(finalAnswers); QuizResultsResponse response = constructor.quizResults(request, null); @@ -163,6 +168,7 @@ public void QuizResultsShouldReturnResultWithAllAnswerTypes() throws Exception { public void QuizResultsAsJsonShouldReturnResultWithAllAnswerTypes() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(finalAnswers); String response = constructor.quizResultsAsJson(request, null); JSONObject jsonObject = new JSONObject(response); @@ -178,6 +184,7 @@ public void QuizResultsAsJsonShouldReturnResultWithAllAnswerTypes() throws Excep public void QuizResultsShouldReturnErrorWithInvalidQuizId() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest("invalidQuiz"); + request.setQuizSessionId(quizSessionId); request.setAnswers(validAnswers); thrown.expect(ConstructorException.class); @@ -191,6 +198,7 @@ public void QuizResultsShouldReturnErrorWithInvalidQuizId() throws Exception { public void QuizResultsAsJsonShouldReturnErrorWithInvalidQuizId() throws Exception { ConstructorIO constructor = new ConstructorIO("", quizKey, true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest("invalidQuiz"); + request.setQuizSessionId(quizSessionId); request.setAnswers(validAnswers); thrown.expect(ConstructorException.class); @@ -204,6 +212,7 @@ public void QuizResultsAsJsonShouldReturnErrorWithInvalidQuizId() throws Excepti public void QuizResultsShouldReturnErrorWithInvalidIndexKey() throws Exception { ConstructorIO constructor = new ConstructorIO("", "invalidKey", true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(validAnswers); thrown.expect(ConstructorException.class); @@ -218,6 +227,7 @@ public void QuizResultsShouldReturnErrorWithInvalidIndexKey() throws Exception { public void QuizResultsAsJsonShouldReturnErrorWithInvalidIndexKey() throws Exception { ConstructorIO constructor = new ConstructorIO("", "invalidKey", true, "quizzes.cnstrc.com"); QuizRequest request = new QuizRequest(quizId); + request.setQuizSessionId(quizSessionId); request.setAnswers(validAnswers); thrown.expect(ConstructorException.class);