diff --git a/src/main/java/com/uniovi/components/QuestionGeneratorTest.java b/src/main/java/com/uniovi/components/QuestionGeneratorTestController.java similarity index 64% rename from src/main/java/com/uniovi/components/QuestionGeneratorTest.java rename to src/main/java/com/uniovi/components/QuestionGeneratorTestController.java index cf549d65..82ba147e 100644 --- a/src/main/java/com/uniovi/components/QuestionGeneratorTest.java +++ b/src/main/java/com/uniovi/components/QuestionGeneratorTestController.java @@ -1,18 +1,18 @@ package com.uniovi.components; -import com.uniovi.components.generators.QuestionGenerator; +import com.uniovi.components.generators.geography.CapitalQuestionGenerator; import com.uniovi.entities.Question; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.List; -@Controller -public class QuestionGeneratorTest { +@RestController +public class QuestionGeneratorTestController { @Autowired - QuestionGenerator qgen; + CapitalQuestionGenerator qgen; @RequestMapping("/test") public void test() { diff --git a/src/main/java/com/uniovi/components/generators/geography/CapitalQuestionGenerator.java b/src/main/java/com/uniovi/components/generators/geography/CapitalQuestionGenerator.java index 4b0a3911..951292fc 100644 --- a/src/main/java/com/uniovi/components/generators/geography/CapitalQuestionGenerator.java +++ b/src/main/java/com/uniovi/components/generators/geography/CapitalQuestionGenerator.java @@ -2,11 +2,13 @@ import com.fasterxml.jackson.databind.JsonNode; import com.uniovi.services.CategoryService; +import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; import java.util.Random; +@Component public class CapitalQuestionGenerator extends AbstractGeographyGenerator{ public CapitalQuestionGenerator(CategoryService categoryService) {