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 b2ca5aa7..60a20769 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 @@ -251,11 +251,39 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { // Nothing } + @Test + @Order(0) + public void testUsecase00_cleanupAllExams() { + final RestServiceImpl restService = createRestServiceForUser( + "admin", + "admin", + new GetExamNames(), + new DeleteExam()); + + final Result> call = restService + .getBuilder(GetExamNames.class) + .call(); + + if (!call.hasError()) { + call.get().stream().forEach(key -> { + final Result deleted = restService + .getBuilder(DeleteExam.class) + .withURIVariable(API.PARAM_MODEL_ID, key.modelId) + .call(); + + if (deleted.hasError()) { + System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%% deletion failed: " + key); + } else { + System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%% deleted: " + key); + } + }); + } + } + @Test @Order(1) // ************************************* // Use Case 1: SEB Administrator creates a new institution and activate this new institution - public void testUsecase01() { final RestServiceImpl restService = createRestServiceForUser( "admin", @@ -830,17 +858,6 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { //assertEquals(Long.valueOf(1), quizData.lmsSetupId); assertEquals(Long.valueOf(4), quizData.institutionId); - // check imported - final Result> checkCall = restService.getBuilder(CheckExamImported.class) - .withURIVariable(API.PARAM_MODEL_ID, quizData.getModelId()) - .call(); - assertFalse(checkCall.hasError()); - final Collection importCheck = checkCall.getOrThrow(); - //assertTrue(importCheck.isEmpty()); // not imported at all - if (!importCheck.isEmpty()) { - System.out.println("******************************* " + importCheck.iterator().next()); - } - // import quiz as exam final Result newExamResult = restService .getBuilder(ImportAsExam.class)