From d696c327630e9585ada6b8243ace735251ef4ede Mon Sep 17 00:00:00 2001 From: anhefti Date: Tue, 8 Oct 2019 11:23:53 +0200 Subject: [PATCH] code cleanup --- .../ch/ethz/seb/sebserver/gui/widget/FileUploadSelection.java | 4 ---- .../java/ch/ethz/seb/sebserver/gui/widget/WidgetFactory.java | 3 ++- .../integration/api/exam/ExamDiscoveryEndpointTest.java | 4 +--- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/widget/FileUploadSelection.java b/src/main/java/ch/ethz/seb/sebserver/gui/widget/FileUploadSelection.java index 4cc1f298..93cb9fe9 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/widget/FileUploadSelection.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/widget/FileUploadSelection.java @@ -31,7 +31,6 @@ import org.eclipse.swt.widgets.Label; import ch.ethz.seb.sebserver.gbl.Constants; import ch.ethz.seb.sebserver.gui.service.i18n.I18nSupport; import ch.ethz.seb.sebserver.gui.service.i18n.LocTextKey; -import ch.ethz.seb.sebserver.gui.service.push.ServerPushService; public class FileUploadSelection extends Composite { @@ -41,7 +40,6 @@ public class FileUploadSelection extends Composite { new LocTextKey("sebserver.overall.upload"); private final I18nSupport i18nSupport; - private final ServerPushService serverPushService; private final List supportedFileExtensions = new ArrayList<>(); private final boolean readonly; @@ -53,7 +51,6 @@ public class FileUploadSelection extends Composite { public FileUploadSelection( final Composite parent, - final ServerPushService serverPushService, final I18nSupport i18nSupport, final boolean readonly) { @@ -66,7 +63,6 @@ public class FileUploadSelection extends Composite { super.setLayout(gridLayout); this.i18nSupport = i18nSupport; - this.serverPushService = serverPushService; this.readonly = readonly; if (readonly) { diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/widget/WidgetFactory.java b/src/main/java/ch/ethz/seb/sebserver/gui/widget/WidgetFactory.java index 15e7de7a..f5b4b9f0 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/widget/WidgetFactory.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/widget/WidgetFactory.java @@ -623,7 +623,8 @@ public class WidgetFactory { final Collection supportedFiles) { final FileUploadSelection fileUploadSelection = - new FileUploadSelection(parent, null, this.i18nSupport, readonly); + new FileUploadSelection(parent, this.i18nSupport, readonly); + if (supportedFiles != null) { supportedFiles.forEach(ext -> fileUploadSelection.withSupportFor(ext)); } diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamDiscoveryEndpointTest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamDiscoveryEndpointTest.java index bb70209d..9fcab9e9 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamDiscoveryEndpointTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/integration/api/exam/ExamDiscoveryEndpointTest.java @@ -16,8 +16,6 @@ import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import com.fasterxml.jackson.databind.ObjectWriter; - import ch.ethz.seb.sebserver.gbl.api.ExamAPIDiscovery; import ch.ethz.seb.sebserver.gbl.api.ExamAPIDiscovery.ExamAPIVersion; import ch.ethz.seb.sebserver.gbl.api.JSONMapper; @@ -37,7 +35,7 @@ public class ExamDiscoveryEndpointTest extends ExamAPIIntegrationTester { .andExpect(status().isOk()) .andReturn().getResponse().getContentAsString(); - final ObjectWriter writer = this.jsonMapper.writerWithDefaultPrettyPrinter(); +// final ObjectWriter writer = this.jsonMapper.writerWithDefaultPrettyPrinter(); final ExamAPIDiscovery examAPIDiscovery = this.jsonMapper.readValue(contentAsString, ExamAPIDiscovery.class); assertNotNull(examAPIDiscovery);