diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBClientConfigForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBClientConfigForm.java index 7ec7b2f4..0f3633df 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBClientConfigForm.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBClientConfigForm.java @@ -71,6 +71,10 @@ public class SEBClientConfigForm implements TemplateComposer { new LocTextKey("sebserver.clientconfig.form.title"); private static final LocTextKey FORM_NAME_TEXT_KEY = new LocTextKey("sebserver.clientconfig.form.name"); + private static final LocTextKey FORM_UPDATE_USER_TEXT_KEY = + new LocTextKey("sebserver.clientconfig.form.update.user"); + private static final LocTextKey FORM_UPDATE_TIME_TEXT_KEY = + new LocTextKey("sebserver.clientconfig.form.update.time"); private static final LocTextKey FORM_DATE_TEXT_KEY = new LocTextKey("sebserver.clientconfig.form.date"); @@ -295,11 +299,31 @@ public class SEBClientConfigForm implements TemplateComposer { Domain.SEB_CLIENT_CONFIGURATION.ATTR_INSTITUTION_ID, String.valueOf(clientConfig.getInstitutionId())) - .addFieldIf(() -> !isNew, + .addFieldIf(() -> isReadonly, () -> FormBuilder.text( Domain.SEB_CLIENT_CONFIGURATION.ATTR_DATE, FORM_DATE_TEXT_KEY, i18nSupport.formatDisplayDateWithTimeZone(clientConfig.date)) + .readonly(true) + .withInputSpan(2) + .withEmptyCellSeparation(false)) + + .addFieldIf(() -> isReadonly, + () -> FormBuilder.text( + Domain.SEB_CLIENT_CONFIGURATION.ATTR_LAST_UPDATE_TIME, + FORM_UPDATE_TIME_TEXT_KEY, + i18nSupport.formatDisplayDateWithTimeZone(clientConfig.lastUpdateTime)) + .readonly(true) + .withLabelSpan(1) + .withInputSpan(2) + .withEmptyCellSeparation(false)) + + .addFieldIf(() -> isReadonly, + () -> FormBuilder.singleSelection( + Domain.SEB_CLIENT_CONFIGURATION.ATTR_LAST_UPDATE_USER, + FORM_UPDATE_USER_TEXT_KEY, + clientConfig.lastUpdateUser, + () -> this.pageService.getResourceService().userResources()) .readonly(true)) .addField(FormBuilder.text( diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigForm.java index 002e9106..e99c0f83 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigForm.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/configs/SEBExamConfigForm.java @@ -81,6 +81,11 @@ public class SEBExamConfigForm implements TemplateComposer { new LocTextKey("sebserver.examconfig.form.title"); static final LocTextKey FORM_NAME_TEXT_KEY = new LocTextKey("sebserver.examconfig.form.name"); + static final LocTextKey FORM_UPDATE_TIME_TEXT_KEY = + new LocTextKey("sebserver.examconfig.form.update.time"); + static final LocTextKey FORM_UPDATE_USER_TEXT_KEY = + new LocTextKey("sebserver.examconfig.form.update.user"); + static final LocTextKey FORM_DESCRIPTION_TEXT_KEY = new LocTextKey("sebserver.examconfig.form.description"); static final LocTextKey FORM_HISTORY_TEXT_KEY = @@ -219,6 +224,28 @@ public class SEBExamConfigForm implements TemplateComposer { : String.valueOf(examConfig.templateId), resourceService::getExamConfigTemplateResources) .readonly(!isNew)) + + .addFieldIf(() -> isReadonly, + () -> FormBuilder.text( + Domain.CONFIGURATION_NODE.ATTR_LAST_UPDATE_TIME, + FORM_UPDATE_TIME_TEXT_KEY, + this.pageService.getI18nSupport() + .formatDisplayDateWithTimeZone(examConfig.lastUpdateTime)) + .readonly(true) + .withInputSpan(2) + .withEmptyCellSeparation(false)) + + .addFieldIf(() -> isReadonly, + () -> FormBuilder.singleSelection( + Domain.SEB_CLIENT_CONFIGURATION.ATTR_LAST_UPDATE_USER, + FORM_UPDATE_USER_TEXT_KEY, + examConfig.lastUpdateUser, + () -> this.pageService.getResourceService().userResources()) + .readonly(true) + .withLabelSpan(1) + .withInputSpan(2) + .withEmptyCellSeparation(false)) + .addField(FormBuilder.text( Domain.CONFIGURATION_NODE.ATTR_NAME, FORM_NAME_TEXT_KEY, diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/DAOUserServcie.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/DAOUserServcie.java new file mode 100644 index 00000000..ce761afa --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/DAOUserServcie.java @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2022 ETH Zürich, Educational Development and Technology (LET) + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package ch.ethz.seb.sebserver.webservice.servicelayer.dao; + +public interface DAOUserServcie { + + String getCurrentUserUUID(); + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java index a9e8124d..d949e137 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationDAOBatchService.java @@ -44,7 +44,6 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationTableValues.TableV import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Utils; -import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser; import ch.ethz.seb.sebserver.webservice.datalayer.batis.BatisConfig; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationAttributeRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationAttributeRecordMapper; @@ -58,6 +57,7 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationAttri import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationNodeRecord; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationRecord; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationValueRecord; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOUserServcie; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; import ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.ExamConfigInitService; @@ -80,10 +80,10 @@ class ConfigurationDAOBatchService { private final ConfigurationRecordMapper batchConfigurationRecordMapper; private final ExamConfigInitService examConfigInitService; private final SqlSessionTemplate batchSqlSessionTemplate; - private final CurrentUser currentUser; + private final DAOUserServcie daoUserServcie; protected ConfigurationDAOBatchService( - final CurrentUser currentUser, + final DAOUserServcie daoUserServcie, @Qualifier(BatisConfig.SQL_BATCH_SESSION_TEMPLATE) final SqlSessionTemplate batchSqlSessionTemplate, final ExamConfigInitService examConfigInitService) { @@ -119,7 +119,7 @@ class ConfigurationDAOBatchService { this.batchConfigurationRecordMapper = batchSqlSessionTemplate.getMapper(ConfigurationRecordMapper.class); this.batchSqlSessionTemplate = batchSqlSessionTemplate; - this.currentUser = currentUser; + this.daoUserServcie = daoUserServcie; } Result createNewConfiguration(final ConfigurationNode data) { @@ -152,7 +152,7 @@ class ConfigurationDAOBatchService { data.type.name(), (data.status != null) ? data.status.name() : ConfigurationStatus.CONSTRUCTION.name(), Utils.getMillisecondsNow(), - this.currentUser.get().getUuid()); + this.daoUserServcie.getCurrentUserUUID()); this.batchConfigurationNodeRecordMapper.insert(newRecord); this.batchSqlSessionTemplate.flushStatements(); @@ -403,7 +403,7 @@ class ConfigurationDAOBatchService { copyInfo.configurationType.name(), ConfigurationStatus.CONSTRUCTION.name(), Utils.getMillisecondsNow(), - this.currentUser.get().getUuid()); + this.daoUserServcie.getCurrentUserUUID()); this.batchConfigurationNodeRecordMapper.insert(newNodeRec); this.batchSqlSessionTemplate.flushStatements(); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java index 9bb8612b..6e3e6409 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ConfigurationNodeDAOImpl.java @@ -42,7 +42,6 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationNode.Configuration import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Utils; -import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationAttributeRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationNodeRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ConfigurationNodeRecordMapper; @@ -61,6 +60,7 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ConfigurationNodeR import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.impl.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ConfigurationNodeDAO; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOUserServcie; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; @@ -77,7 +77,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO { private final ExamTemplateRecordMapper examTemplateRecordMapper; private final ViewRecordMapper viewRecordMapper; private final OrientationRecordMapper orientationRecordMapper; - private final CurrentUser currentUser; + private final DAOUserServcie daoUserServcie; protected ConfigurationNodeDAOImpl( final ConfigurationRecordMapper configurationRecordMapper, @@ -88,7 +88,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO { final ExamTemplateRecordMapper examTemplateRecordMapper, final ViewRecordMapper viewRecordMapper, final OrientationRecordMapper orientationRecordMapper, - final CurrentUser currentUser) { + final DAOUserServcie daoUserServcie) { this.configurationRecordMapper = configurationRecordMapper; this.configurationNodeRecordMapper = configurationNodeRecordMapper; @@ -97,7 +97,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO { this.examTemplateRecordMapper = examTemplateRecordMapper; this.viewRecordMapper = viewRecordMapper; this.orientationRecordMapper = orientationRecordMapper; - this.currentUser = currentUser; + this.daoUserServcie = daoUserServcie; } @Override @@ -240,7 +240,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO { null, (data.status != null) ? data.status.name() : ConfigurationStatus.CONSTRUCTION.name(), Utils.getMillisecondsNow(), - this.currentUser.get().getUuid()); + this.daoUserServcie.getCurrentUserUUID()); this.configurationNodeRecordMapper.updateByPrimaryKeySelective(newRecord); return this.configurationNodeRecordMapper.selectByPrimaryKey(data.id); @@ -336,7 +336,7 @@ public class ConfigurationNodeDAOImpl implements ConfigurationNodeDAO { this.configurationNodeRecordMapper.updateByExampleSelective( new ConfigurationNodeRecord(null, null, 0L, null, null, null, null, null, Utils.getMillisecondsNow(), - this.currentUser.get().getUuid())) + this.daoUserServcie.getCurrentUserUUID())) .where(ConfigurationNodeRecordDynamicSqlSupport.templateId, isIn(configurationIds)) .build() .execute(); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/DAOUserServcieImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/DAOUserServcieImpl.java new file mode 100644 index 00000000..162b31c8 --- /dev/null +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/DAOUserServcieImpl.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 ETH Zürich, Educational Development and Technology (LET) + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package ch.ethz.seb.sebserver.webservice.servicelayer.dao.impl; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Service; + +import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; +import ch.ethz.seb.sebserver.webservice.servicelayer.authorization.AuthorizationService; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOUserServcie; + +@Lazy +@Service +@WebServiceProfile +public class DAOUserServcieImpl implements DAOUserServcie { + + private static final Logger log = LoggerFactory.getLogger(DAOUserServcieImpl.class); + + private final AuthorizationService authorizationService; + + public DAOUserServcieImpl(final AuthorizationService authorizationService) { + this.authorizationService = authorizationService; + } + + @Override + public String getCurrentUserUUID() { + try { + return this.authorizationService.getUserService().getCurrentUser().uuid(); + } catch (final Exception e) { + log.error("Failed to get current user: ", e); + return null; + } + } + +} diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SEBClientConfigDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SEBClientConfigDAOImpl.java index 5bd8fb66..415ae5ca 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SEBClientConfigDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/SEBClientConfigDAOImpl.java @@ -44,13 +44,13 @@ import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig.VDIType; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.util.Result; import ch.ethz.seb.sebserver.gbl.util.Utils; -import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.CurrentUser; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.SebClientConfigRecordDynamicSqlSupport; import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.SebClientConfigRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.AdditionalAttributeRecord; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.SebClientConfigRecord; import ch.ethz.seb.sebserver.webservice.servicelayer.bulkaction.impl.BulkAction; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOUserServcie; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO; @@ -64,18 +64,18 @@ public class SEBClientConfigDAOImpl implements SEBClientConfigDAO { private final SebClientConfigRecordMapper sebClientConfigRecordMapper; private final ClientCredentialService clientCredentialService; private final AdditionalAttributesDAOImpl additionalAttributesDAO; - private final CurrentUser currentUser; + private final DAOUserServcie daoUserServcie; protected SEBClientConfigDAOImpl( final SebClientConfigRecordMapper sebClientConfigRecordMapper, final ClientCredentialService clientCredentialService, final AdditionalAttributesDAOImpl additionalAttributesDAO, - final CurrentUser currentUser) { + final DAOUserServcie daoUserServcie) { this.sebClientConfigRecordMapper = sebClientConfigRecordMapper; this.clientCredentialService = clientCredentialService; this.additionalAttributesDAO = additionalAttributesDAO; - this.currentUser = currentUser; + this.daoUserServcie = daoUserServcie; } @Override @@ -208,7 +208,7 @@ public class SEBClientConfigDAOImpl implements SEBClientConfigDAO { null, null, null, null, null, null, null, BooleanUtils.toIntegerObject(active), Utils.getMillisecondsNow(), - this.currentUser.get().getUuid()); + this.daoUserServcie.getCurrentUserUUID()); this.sebClientConfigRecordMapper.updateByExampleSelective(record) .where(SebClientConfigRecordDynamicSqlSupport.id, isIn(ids)) @@ -240,7 +240,7 @@ public class SEBClientConfigDAOImpl implements SEBClientConfigDAO { getEncryptionPassword(sebClientConfig), BooleanUtils.toInteger(BooleanUtils.isTrue(sebClientConfig.active)), Utils.getMillisecondsNow(), - this.currentUser.get().getUuid()); + this.daoUserServcie.getCurrentUserUUID()); this.sebClientConfigRecordMapper .insert(newRecord); @@ -273,7 +273,7 @@ public class SEBClientConfigDAOImpl implements SEBClientConfigDAO { getEncryptionPassword(sebClientConfig), record.getActive(), Utils.getMillisecondsNow(), - this.currentUser.get().getUuid()); + this.daoUserServcie.getCurrentUserUUID()); this.sebClientConfigRecordMapper.updateByPrimaryKey(newRecord); diff --git a/src/main/resources/config/sql/base/V15__alterTables_v1_4.sql b/src/main/resources/config/sql/base/V15__alterTables_v1_4.sql index 9ca52ab5..0d4f6a9a 100644 --- a/src/main/resources/config/sql/base/V15__alterTables_v1_4.sql +++ b/src/main/resources/config/sql/base/V15__alterTables_v1_4.sql @@ -7,3 +7,22 @@ MODIFY `source_ids` VARCHAR(4000) NULL, ADD COLUMN IF NOT EXISTS `owner` VARCHAR(255) NULL AFTER `institution_id`, ADD COLUMN IF NOT EXISTS `attributes` VARCHAR(4000) NULL AFTER `action_type` ; + +-- ----------------------------------------------------- +-- Alter Table `configuration_node` +-- ----------------------------------------------------- + +ALTER TABLE `configuration_node` +ADD COLUMN IF NOT EXISTS `last_update_time` BIGINT UNSIGNED NULL AFTER `status`, +ADD COLUMN IF NOT EXISTS `last_update_user` VARCHAR(255) NULL AFTER `last_update_time` +; + +-- ----------------------------------------------------- +-- Alter Table `seb_client_configuration` +-- ----------------------------------------------------- + +ALTER TABLE `seb_client_configuration` +ADD COLUMN IF NOT EXISTS `last_update_time` BIGINT UNSIGNED NULL AFTER `active`, +ADD COLUMN IF NOT EXISTS `last_update_user` VARCHAR(255) NULL AFTER `last_update_time` +; + diff --git a/src/main/resources/config/sql/base/V16__alterTables_v1_4.sql b/src/main/resources/config/sql/base/V16__alterTables_v1_4.sql deleted file mode 100644 index 3dd9a258..00000000 --- a/src/main/resources/config/sql/base/V16__alterTables_v1_4.sql +++ /dev/null @@ -1,16 +0,0 @@ --- ----------------------------------------------------- --- Alter Table `configuration_node` --- ----------------------------------------------------- - -ALTER TABLE `configuration_node` -ADD COLUMN IF NOT EXISTS `last_update_time` BIGINT UNSIGNED NULL AFTER `status`, -ADD COLUMN IF NOT EXISTS `last_update_user` VARCHAR(255) NULL AFTER `last_update_time` - --- ----------------------------------------------------- --- Alter Table `seb_client_configuration` --- ----------------------------------------------------- - -ALTER TABLE `seb_client_configuration` -ADD COLUMN IF NOT EXISTS `last_update_time` BIGINT UNSIGNED NULL AFTER `active`, -ADD COLUMN IF NOT EXISTS `last_update_user` VARCHAR(255) NULL AFTER `last_update_time` -; diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index eebe550c..f99ded4b 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -760,6 +760,8 @@ sebserver.clientconfig.form.title.subtitle= sebserver.clientconfig.form.name=Name sebserver.clientconfig.form.name.tooltip=The name of the connection configuration.
Any name that not already is in use for another connection configuration +sebserver.clientconfig.form.update.time Last Update +sebserver.clientconfig.form.update.user=Last Update By sebserver.clientconfig.form.pinginterval=Ping Interval sebserver.clientconfig.form.pinginterval.tooltip=Defines an interval time in milliseconds for a SEB client to send a ping to the SEB Server sebserver.clientconfig.form.vditype=VDI Setup @@ -910,6 +912,9 @@ sebserver.examconfig.form.status.tooltip=The status of this SEB exam configurati sebserver.examconfig.form.config-key.title=Config Key sebserver.examconfig.form.attached-to=Attached To Exam sebserver.examconfig.form.attached-to.tooltip=This SEB exam configuration is currently attached to the following exams.

Select an exam from the list and use the "View Exam" or Double-Click on the list to go to a specific exam. +sebserver.examconfig.form.update.time=Last Update +sebserver.examconfig.form.update.user=Last Update By + sebserver.examconfig.status.CONSTRUCTION=Under Construction sebserver.examconfig.status.READY_TO_USE=Ready To Use diff --git a/src/test/java/ch/ethz/seb/sebserver/gbl/model/ModelObjectJSONGenerator.java b/src/test/java/ch/ethz/seb/sebserver/gbl/model/ModelObjectJSONGenerator.java index 99c4b071..4b9f8f94 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gbl/model/ModelObjectJSONGenerator.java +++ b/src/test/java/ch/ethz/seb/sebserver/gbl/model/ModelObjectJSONGenerator.java @@ -129,13 +129,15 @@ public class ModelObjectJSONGenerator { "encryptSecretConfirm", "certAlias", false, - true); + true, + DateTime.now(), + "user123"); System.out.println(domainObject.getClass().getSimpleName() + ":"); System.out.println(writerWithDefaultPrettyPrinter.writeValueAsString(domainObject)); domainObject = new ConfigurationNode( 1L, 1L, 1L, "name", "description", ConfigurationType.EXAM_CONFIG, "ownerUUID", - ConfigurationStatus.CONSTRUCTION); + ConfigurationStatus.CONSTRUCTION, DateTime.now(), "user123"); System.out.println(domainObject.getClass().getSimpleName() + ":"); System.out.println(writerWithDefaultPrettyPrinter.writeValueAsString(domainObject)); diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/ClientConfigTest.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/ClientConfigTest.java index b51308a3..f5aabb5a 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gui/integration/ClientConfigTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/ClientConfigTest.java @@ -126,6 +126,8 @@ public class ClientConfigTest extends GuiIntegrationTest { null, "certAlias", false, + null, + null, null)) .call(); @@ -157,6 +159,8 @@ public class ClientConfigTest extends GuiIntegrationTest { "password", "certAlias", false, + null, + null, null)) .call() .getOrThrow(); 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 ddca14d0..5caf7ce7 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 @@ -30,6 +30,7 @@ import java.util.stream.Collectors; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.After; import org.junit.Before; @@ -1715,7 +1716,9 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { config.description, ConfigurationType.EXAM_CONFIG, config.owner, - ConfigurationStatus.READY_TO_USE); + ConfigurationStatus.READY_TO_USE, + DateTime.now(), + config.owner); final ConfigurationNode savedConfig = restService .getBuilder(SaveExamConfig.class) diff --git a/src/test/resources/data-test-additional.sql b/src/test/resources/data-test-additional.sql index 9fb96552..924a2daa 100644 --- a/src/test/resources/data-test-additional.sql +++ b/src/test/resources/data-test-additional.sql @@ -3,8 +3,8 @@ INSERT IGNORE INTO lms_setup VALUES ; INSERT IGNORE INTO seb_client_configuration VALUES - (1, 1, 'test', '2019-07-02 09:22:50', 'test', '98ac3c953abf5948d9d13c81cab580819ee2624c76d6d4147d4896a5b79f49956d382c08c93cb3b9ae350b32', null, 1), - (2, 1, 'testVDI', '2019-07-02 09:22:50', 'testVDI', '8b92ecd63305c97c359b5f39ba707356e2487cf118eb783b92fb7c6cdb217f87709fefa03abb13f8b4e5a14fa2c2ba', null, 1) + (1, 1, 'test', '2019-07-02 09:22:50', 'test', '98ac3c953abf5948d9d13c81cab580819ee2624c76d6d4147d4896a5b79f49956d382c08c93cb3b9ae350b32', null, 1, null, null), + (2, 1, 'testVDI', '2019-07-02 09:22:50', 'testVDI', '8b92ecd63305c97c359b5f39ba707356e2487cf118eb783b92fb7c6cdb217f87709fefa03abb13f8b4e5a14fa2c2ba', null, 1, null, null) ; INSERT IGNORE INTO additional_attributes VALUES @@ -526,7 +526,7 @@ INSERT IGNORE INTO orientation VALUES ; INSERT IGNORE INTO configuration_node VALUES - (1, 1, 0, 'super-admin', 'test', null, 'EXAM_CONFIG', 'READY_TO_USE') + (1, 1, 0, 'super-admin', 'test', null, 'EXAM_CONFIG', 'READY_TO_USE', null, null) ; INSERT IGNORE INTO configuration VALUES