diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java index c541751f..5e00179a 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java @@ -163,7 +163,7 @@ public class LmsSetupDAOImpl implements LmsSetupDAO { final ClientCredentials proxyCredentials = createProxyClientCredentials(lmsSetup); final LmsSetupRecord newRecord = new LmsSetupRecord( lmsSetup.id, - lmsSetup.institutionId, + null, lmsSetup.name, (lmsSetup.lmsType != null) ? lmsSetup.lmsType.name() : null, lmsSetup.lmsApiUrl, @@ -180,7 +180,7 @@ public class LmsSetupDAOImpl implements LmsSetupDAO { proxyCredentials.secretAsString(), savedRecord.getActive()); - this.lmsSetupRecordMapper.updateByPrimaryKey(newRecord); + this.lmsSetupRecordMapper.updateByPrimaryKeySelective(newRecord); return this.lmsSetupRecordMapper.selectByPrimaryKey(lmsSetup.id); }) .flatMap(this::toDomainModel) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java index 1fddc7be..24048128 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java @@ -22,7 +22,6 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Lazy; -import org.springframework.context.event.EventListener; import org.springframework.stereotype.Service; import ch.ethz.seb.sebserver.gbl.Constants; @@ -74,22 +73,22 @@ public class LmsAPIServiceImpl implements LmsAPIService { this.templateFactories = new EnumMap<>(factories); } - /** Listen to LmsSetupChangeEvent to release an affected LmsAPITemplate from cache - * - * @param event the event holding the changed LmsSetup */ - @EventListener - public void notifyLmsSetupChange(final LmsSetupChangeEvent event) { - final LmsSetup lmsSetup = event.getLmsSetup(); - if (lmsSetup == null) { - return; - } - - if (log.isDebugEnabled()) { - log.debug("LmsSetup changed. Update cache by removing eventually used references"); - } - - this.cache.remove(new CacheKey(lmsSetup.getModelId(), 0)); - } +// /** Listen to LmsSetupChangeEvent to release an affected LmsAPITemplate from cache +// * +// * @param event the event holding the changed LmsSetup */ +// @EventListener +// public void notifyLmsSetupChange(final LmsSetupChangeEvent event) { +// final LmsSetup lmsSetup = event.getLmsSetup(); +// if (lmsSetup == null) { +// return; +// } +// +// if (log.isDebugEnabled()) { +// log.debug("LmsSetup changed. Update cache by removing eventually used references"); +// } +// +// this.cache.remove(new CacheKey(lmsSetup.getModelId(), 0)); +// } @Override public void cleanup() { 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 825cf46b..2fcb68fd 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,9 +768,8 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { final QuizData quizData = quizzes.content.get(0); assertNotNull(quizData); assertEquals("Demo Quiz 1 (MOCKUP)", quizData.name); - - System.out.println("***************************** quizzes " + quizzes.content); - + assertEquals(quizData.institutionId, Long.valueOf(4)); + assertEquals(quizData.lmsSetupId, Long.valueOf(1)); // import quiz as exam final Result newExamResult = restService .getBuilder(ImportAsExam.class) @@ -780,10 +779,6 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { .call(); assertNotNull(newExamResult); - if (newExamResult.hasError()) { - System.out.println("***************************** " + newExamResult.getError().getMessage()); - newExamResult.getError().printStackTrace(); - } assertFalse(newExamResult.hasError()); final Exam newExam = newExamResult.get();