Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
uo287545 committed Apr 8, 2024
1 parent 1dda1f4 commit b13c746
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/test/java/com/uniovi/Wiq_UnitTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Question> questions = questionService.getAllQuestions();
Expand All @@ -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<Question> questions = questionService.getRandomQuestions(5);
Expand All @@ -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<Question> questions = borderQuestionGenerator.getQuestions();
Assertions.assertFalse(questions.isEmpty());
Expand All @@ -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<Question> questions = capitalQuestionGenerator.getQuestions();
Assertions.assertFalse(questions.isEmpty());
Expand All @@ -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<Question> questions = continentQuestionGenerator.getQuestions();
Assertions.assertFalse(questions.isEmpty());
Expand Down Expand Up @@ -1619,7 +1619,7 @@ private JSONObject parseJsonResponse(HttpResponse<String> response) throws JSONE
/**
* Inserts some sample questions into the database
*/
private void insertSomeQuestions() throws InterruptedException {
private void insertSomeQuestions() throws InterruptedException, IOException {
List<Question> qs = new ContinentQuestionGeneration(categoryService, Question.SPANISH).getQuestions();
qs.forEach(questionService::addNewQuestion);
}
Expand Down

0 comments on commit b13c746

Please sign in to comment.