From eb71c4bcc40a79af99d0d9a1af67c981213c4634 Mon Sep 17 00:00:00 2001 From: anhefti Date: Tue, 10 Sep 2019 13:50:42 +0200 Subject: [PATCH] fixes --- .../gui/content/activity/ActivitiesPane.java | 21 ++++++-------- .../integration/UseCasesIntegrationTest.java | 28 +++++++++++++++++++ 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java index 69cbeb1e..e0838ee9 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java @@ -157,9 +157,10 @@ public class ActivitiesPane implements TemplateComposer { .create()); } - if (this.currentUser.get().hasAnyRole(UserRole.SEB_SERVER_ADMIN, UserRole.INSTITUTIONAL_ADMIN)) { - sebadmin.setExpanded(true); - } + sebadmin.setExpanded(this.currentUser.get().hasAnyRole( + UserRole.SEB_SERVER_ADMIN, + UserRole.INSTITUTIONAL_ADMIN)); + // ---- SEB ADMIN ---------------------------------------------------------------------- //-------------------------------------------------------------------------------------- @@ -203,9 +204,7 @@ public class ActivitiesPane implements TemplateComposer { .create()); } - if (this.currentUser.get().hasAnyRole(UserRole.EXAM_ADMIN)) { - sebConfigs.setExpanded(true); - } + sebConfigs.setExpanded(this.currentUser.get().hasAnyRole(UserRole.EXAM_ADMIN)); } // ---- SEB CONFIGURATION -------------------------------------------------------------- @@ -260,9 +259,7 @@ public class ActivitiesPane implements TemplateComposer { .create()); } - if (this.currentUser.get().hasAnyRole(UserRole.EXAM_ADMIN)) { - examadmin.setExpanded(true); - } + examadmin.setExpanded(this.currentUser.get().hasAnyRole(UserRole.EXAM_ADMIN)); } // ---- EXAM ADMINISTRATION ------------------------------------------------------------ @@ -311,9 +308,7 @@ public class ActivitiesPane implements TemplateComposer { .create()); } - if (this.currentUser.get().hasAnyRole(UserRole.EXAM_SUPPORTER)) { - monitoring.setExpanded(true); - } + monitoring.setExpanded(this.currentUser.get().hasAnyRole(UserRole.EXAM_SUPPORTER)); } // ---- MONITORING --------------------------------------------------------------------- @@ -372,7 +367,7 @@ public class ActivitiesPane implements TemplateComposer { } else if (this.currentUser.get().hasAnyRole(UserRole.EXAM_ADMIN)) { return findItemByActionDefinition( navigation.getItems(), - ActivityDefinition.SEB_CONFIGURATION); + ActivityDefinition.SEB_EXAM_CONFIG); } else if (this.currentUser.get().hasAnyRole(UserRole.EXAM_SUPPORTER)) { return findItemByActionDefinition( navigation.getItems(), 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 fa8e2d59..16a6bd45 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 @@ -77,6 +77,7 @@ import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig. import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig.GetClientConfigPage; import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig.NewClientConfig; import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.clientconfig.SaveClientConfig; +import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.seb.examconfig.NewExamConfig; import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.ActivateUserAccount; import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.ChangePassword; import ch.ethz.seb.sebserver.gui.service.remote.webservice.api.useraccount.GetUserAccount; @@ -864,6 +865,33 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { assertNotNull(readLines); assertFalse(readLines.isEmpty()); assertTrue(readLines.get(0).startsWith("pswd")); + + // get page + final Result> pageResponse = restService + .getBuilder(GetClientConfigPage.class) + .call(); + + assertNotNull(pageResponse); + assertFalse(pageResponse.hasError()); + final Page page = pageResponse.get(); + assertFalse(page.content.isEmpty()); + assertTrue(page.content.size() == 2); + } + + @Test + @Order(9) + // ************************************* + // Use Case 9: Login as examAdmin2 and create a new SEB Exam Configuration + // - save configuration in history + // - change some attribute + // - process an undo + // - table value add, delete, modify + // - export + public void testUsecase9() throws IOException { + final RestServiceImpl restService = createRestServiceForUser( + "examAdmin2", + "examAdmin2", + new NewExamConfig()); } }