From 32254dea4f51e75dfef4d612334782e53c55d721 Mon Sep 17 00:00:00 2001 From: Mister-Mario Date: Sat, 27 Apr 2024 22:34:40 +0200 Subject: [PATCH] Small tweaks --- gatewayservice/gateway-service.js | 2 +- questionGenerator/src/main/java/Main.java | 2 +- questionGenerator/src/main/java/MainStatic.java | 1 - .../src/main/java/questionGenerator/QuestionGenerator.java | 1 - .../answersAreEntites/AbstractAnswersAreEntites.java | 2 +- .../src/main/java/questionGenerator/question/Question.java | 6 ------ webapp/e2e/steps/competitiveGame.steps.js | 2 +- 7 files changed, 4 insertions(+), 12 deletions(-) diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index 0bcefac1..bab68145 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -21,7 +21,7 @@ const transporter = nodemailer.createTransport({ }); const authServiceUrl = process.env.AUTH_SERVICE_URL || 'http://localhost:8002'; -const userServiceUrl = process.env.USER_SERVICE_URL || 'http://localhost:8011'; +const userServiceUrl = process.env.USER_SERVICE_URL || 'http://localhost:8001'; const questionServiceUrl = process.env.QUESTION_SERVICE_URL || 'http://localhost:8003'; const recordServiceUrl = process.env.RECORD_SERVICE_URL || 'http://localhost:8004'; diff --git a/questionGenerator/src/main/java/Main.java b/questionGenerator/src/main/java/Main.java index 312f9930..cd0480f8 100644 --- a/questionGenerator/src/main/java/Main.java +++ b/questionGenerator/src/main/java/Main.java @@ -24,7 +24,7 @@ public class Main { QuestionType.SIZE, QuestionType.HEAD_OF_GOVERMENT}; //, QuestionType.VIDEOGAME_DEVELOPER, QuestionType.VIDEOGAME_PUBLISHER, QuestionType.VIDEOGAME_GENRE, QuestionType.VIDEOGAME_COUNTRY}; - private static final int NUMBER_OF_QUESTIONS = 50; + private static final int NUMBER_OF_QUESTIONS = 20; //private static final int NUMBER_OF_QUESTIONS = 75; //private static final int NUMBER_OF_QUESTIONS = 3; //private static final int NUMBER_OF_QUESTIONS = 1; diff --git a/questionGenerator/src/main/java/MainStatic.java b/questionGenerator/src/main/java/MainStatic.java index 42cfba1e..f3e37431 100644 --- a/questionGenerator/src/main/java/MainStatic.java +++ b/questionGenerator/src/main/java/MainStatic.java @@ -29,7 +29,6 @@ private static void run(QuestionGenerator qg, QuestionType type, int numberOfQue List questions = qg.generateQuestions(type, numberOfQuestions); for(int i=0; i generateQuestions(QuestionType type, int amount){ try { q = generator.generate(entity); questions.add(q); - System.out.println(questions.size()); } catch(RuntimeException e) { /* * Sometimes not all the parameters for generating can be passed in the query, so this diff --git a/questionGenerator/src/main/java/questionGenerator/generator/answersAreEntites/AbstractAnswersAreEntites.java b/questionGenerator/src/main/java/questionGenerator/generator/answersAreEntites/AbstractAnswersAreEntites.java index 963104e7..49cf2ea0 100644 --- a/questionGenerator/src/main/java/questionGenerator/generator/answersAreEntites/AbstractAnswersAreEntites.java +++ b/questionGenerator/src/main/java/questionGenerator/generator/answersAreEntites/AbstractAnswersAreEntites.java @@ -47,7 +47,7 @@ private String getAnswer(String id) throws Exception{ public List getWrongAnswers(String rightAnswer) throws Exception { List entites = new ArrayList<>(); try { - entites = EntityGenerator.getEntities(type, getSampleSize(), getPropertyId()); + entites = EntityGenerator.getEntities(type, 20, getPropertyId()); } catch (IOException e) { e.printStackTrace(); } diff --git a/questionGenerator/src/main/java/questionGenerator/question/Question.java b/questionGenerator/src/main/java/questionGenerator/question/Question.java index 7068cbd6..7e9a33f3 100644 --- a/questionGenerator/src/main/java/questionGenerator/question/Question.java +++ b/questionGenerator/src/main/java/questionGenerator/question/Question.java @@ -9,7 +9,6 @@ public class Question { private String question; private List answers; - private int number = -1; private String language; private QuestionType type; @@ -43,17 +42,12 @@ public void setAnswers(List answers) { public void addRightAnswer(String answer) { answers.add(0, answer); } - - public void setNumber(int number){ - this.number = number; - } public JSONObject getJSON() { JSONObject json = new JSONObject(); json.accumulate("question", question); for(String s : answers) json.accumulate("answers", s); - if(number != -1) json.accumulate("number", number); //Para que los tests pasen json.accumulate("language", language); json.accumulate("type", type); return json; diff --git a/webapp/e2e/steps/competitiveGame.steps.js b/webapp/e2e/steps/competitiveGame.steps.js index ab5ad9e2..6e65e983 100644 --- a/webapp/e2e/steps/competitiveGame.steps.js +++ b/webapp/e2e/steps/competitiveGame.steps.js @@ -17,7 +17,7 @@ defineFeature(feature, test => { beforeAll(async () => { browser = await puppeteer.launch({ - headless: "new", + headless: false, slowMo: 40, defaultViewport: { width: 1920, height: 1080 }, args: ['--window-size=1920,1080']