From b13c7464a82f3faf877e131606978a9768ee9d6a Mon Sep 17 00:00:00 2001 From: uo287545 Date: Tue, 9 Apr 2024 00:32:02 +0200 Subject: [PATCH] Fixed unit tests --- src/test/java/com/uniovi/Wiq_UnitTests.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/uniovi/Wiq_UnitTests.java b/src/test/java/com/uniovi/Wiq_UnitTests.java index a8ece280..c28558c4 100644 --- a/src/test/java/com/uniovi/Wiq_UnitTests.java +++ b/src/test/java/com/uniovi/Wiq_UnitTests.java @@ -104,7 +104,7 @@ public void testPlayerService() { } @Test @Order(2) - public void testQuestions() throws InterruptedException { + public void testQuestions() throws InterruptedException, IOException { sampleDataService.insertSampleQuestions(); sampleDataService.generateSampleData(); List questions = questionService.getAllQuestions(); @@ -113,7 +113,7 @@ public void testQuestions() throws InterruptedException { } @Test @Order(2) - public void testRandomQuestions() throws InterruptedException { + public void testRandomQuestions() throws InterruptedException, IOException { sampleDataService.insertSampleQuestions(); sampleDataService.generateSampleData(); List questions = questionService.getRandomQuestions(5); @@ -122,7 +122,7 @@ public void testRandomQuestions() throws InterruptedException { @Test @Order(3) - public void testBorderQuestionsGenerator() throws InterruptedException { + public void testBorderQuestionsGenerator() throws InterruptedException, IOException { BorderQuestionGenerator borderQuestionGenerator=new BorderQuestionGenerator(categoryService,Question.SPANISH); List questions = borderQuestionGenerator.getQuestions(); Assertions.assertFalse(questions.isEmpty()); @@ -136,7 +136,7 @@ public void testBorderQuestionsGenerator() throws InterruptedException { @Test @Order(4) - public void testCapitalQuestionsGenerator() throws InterruptedException { + public void testCapitalQuestionsGenerator() throws InterruptedException, IOException { CapitalQuestionGenerator capitalQuestionGenerator=new CapitalQuestionGenerator(categoryService,Question.SPANISH); List questions = capitalQuestionGenerator.getQuestions(); Assertions.assertFalse(questions.isEmpty()); @@ -150,7 +150,7 @@ public void testCapitalQuestionsGenerator() throws InterruptedException { @Test @Order(5) - public void testContinentQuestionsGenerator() throws InterruptedException { + public void testContinentQuestionsGenerator() throws InterruptedException, IOException { ContinentQuestionGeneration continentQuestionGenerator=new ContinentQuestionGeneration(categoryService,Question.SPANISH); List questions = continentQuestionGenerator.getQuestions(); Assertions.assertFalse(questions.isEmpty()); @@ -1619,7 +1619,7 @@ private JSONObject parseJsonResponse(HttpResponse response) throws JSONE /** * Inserts some sample questions into the database */ - private void insertSomeQuestions() throws InterruptedException { + private void insertSomeQuestions() throws InterruptedException, IOException { List qs = new ContinentQuestionGeneration(categoryService, Question.SPANISH).getQuestions(); qs.forEach(questionService::addNewQuestion); }