test build

This commit is contained in:
anhefti 2021-05-17 11:14:42 +02:00
parent 6cb2f78759
commit c73fd355a4
3 changed files with 20 additions and 26 deletions

View file

@ -163,7 +163,7 @@ public class LmsSetupDAOImpl implements LmsSetupDAO {
final ClientCredentials proxyCredentials = createProxyClientCredentials(lmsSetup); final ClientCredentials proxyCredentials = createProxyClientCredentials(lmsSetup);
final LmsSetupRecord newRecord = new LmsSetupRecord( final LmsSetupRecord newRecord = new LmsSetupRecord(
lmsSetup.id, lmsSetup.id,
lmsSetup.institutionId, null,
lmsSetup.name, lmsSetup.name,
(lmsSetup.lmsType != null) ? lmsSetup.lmsType.name() : null, (lmsSetup.lmsType != null) ? lmsSetup.lmsType.name() : null,
lmsSetup.lmsApiUrl, lmsSetup.lmsApiUrl,
@ -180,7 +180,7 @@ public class LmsSetupDAOImpl implements LmsSetupDAO {
proxyCredentials.secretAsString(), proxyCredentials.secretAsString(),
savedRecord.getActive()); savedRecord.getActive());
this.lmsSetupRecordMapper.updateByPrimaryKey(newRecord); this.lmsSetupRecordMapper.updateByPrimaryKeySelective(newRecord);
return this.lmsSetupRecordMapper.selectByPrimaryKey(lmsSetup.id); return this.lmsSetupRecordMapper.selectByPrimaryKey(lmsSetup.id);
}) })
.flatMap(this::toDomainModel) .flatMap(this::toDomainModel)

View file

@ -22,7 +22,6 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import ch.ethz.seb.sebserver.gbl.Constants; import ch.ethz.seb.sebserver.gbl.Constants;
@ -74,22 +73,22 @@ public class LmsAPIServiceImpl implements LmsAPIService {
this.templateFactories = new EnumMap<>(factories); this.templateFactories = new EnumMap<>(factories);
} }
/** Listen to LmsSetupChangeEvent to release an affected LmsAPITemplate from cache // /** Listen to LmsSetupChangeEvent to release an affected LmsAPITemplate from cache
* // *
* @param event the event holding the changed LmsSetup */ // * @param event the event holding the changed LmsSetup */
@EventListener // @EventListener
public void notifyLmsSetupChange(final LmsSetupChangeEvent event) { // public void notifyLmsSetupChange(final LmsSetupChangeEvent event) {
final LmsSetup lmsSetup = event.getLmsSetup(); // final LmsSetup lmsSetup = event.getLmsSetup();
if (lmsSetup == null) { // if (lmsSetup == null) {
return; // return;
} // }
//
if (log.isDebugEnabled()) { // if (log.isDebugEnabled()) {
log.debug("LmsSetup changed. Update cache by removing eventually used references"); // log.debug("LmsSetup changed. Update cache by removing eventually used references");
} // }
//
this.cache.remove(new CacheKey(lmsSetup.getModelId(), 0)); // this.cache.remove(new CacheKey(lmsSetup.getModelId(), 0));
} // }
@Override @Override
public void cleanup() { public void cleanup() {

View file

@ -768,9 +768,8 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
final QuizData quizData = quizzes.content.get(0); final QuizData quizData = quizzes.content.get(0);
assertNotNull(quizData); assertNotNull(quizData);
assertEquals("Demo Quiz 1 (MOCKUP)", quizData.name); assertEquals("Demo Quiz 1 (MOCKUP)", quizData.name);
assertEquals(quizData.institutionId, Long.valueOf(4));
System.out.println("***************************** quizzes " + quizzes.content); assertEquals(quizData.lmsSetupId, Long.valueOf(1));
// import quiz as exam // import quiz as exam
final Result<Exam> newExamResult = restService final Result<Exam> newExamResult = restService
.getBuilder(ImportAsExam.class) .getBuilder(ImportAsExam.class)
@ -780,10 +779,6 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
.call(); .call();
assertNotNull(newExamResult); assertNotNull(newExamResult);
if (newExamResult.hasError()) {
System.out.println("***************************** " + newExamResult.getError().getMessage());
newExamResult.getError().printStackTrace();
}
assertFalse(newExamResult.hasError()); assertFalse(newExamResult.hasError());
final Exam newExam = newExamResult.get(); final Exam newExam = newExamResult.get();