From 73a94fcc7c1fa68f93cd3fd6b71b75b25a71c97e Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 17 May 2021 11:54:17 +0200 Subject: [PATCH] fix tests --- .../seb/sebserver/gui/integration/GuiIntegrationTest.java | 2 +- .../sebserver/gui/integration/UseCasesIntegrationTest.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/GuiIntegrationTest.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/GuiIntegrationTest.java index 934ee736..5ff8dada 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gui/integration/GuiIntegrationTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/GuiIntegrationTest.java @@ -43,7 +43,7 @@ import ch.ethz.seb.sebserver.webservice.servicelayer.dao.WebserviceInfoDAO; @SpringBootTest( properties = "file.encoding=UTF-8", classes = SEBServer.class, - webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) + webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @ActiveProfiles("test") @AutoConfigureMockMvc public abstract class GuiIntegrationTest { diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java index 2fcb68fd..2e25bb42 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java @@ -768,8 +768,9 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { final QuizData quizData = quizzes.content.get(0); assertNotNull(quizData); assertEquals("Demo Quiz 1 (MOCKUP)", quizData.name); - assertEquals(quizData.institutionId, Long.valueOf(4)); - assertEquals(quizData.lmsSetupId, Long.valueOf(1)); + assertEquals(Long.valueOf(1), quizData.lmsSetupId); + assertEquals(Long.valueOf(4), quizData.institutionId); + // import quiz as exam final Result newExamResult = restService .getBuilder(ImportAsExam.class) @@ -2555,7 +2556,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { .getOrThrow(); assertNotNull(testResult); - System.out.print("********************** testResult: " + testResult); +// System.out.print("********************** testResult: " + testResult); // assertFalse(testResult.isOk()); // assertEquals("[Error [errorType=TOKEN_REQUEST, message=Failed to gain access token from OpenEdX Rest API:\n" + // " tried token endpoints: [/oauth2/access_token]]]", String.valueOf(testResult.errors));