fixed tests

This commit is contained in:
anhefti 2021-05-17 12:08:07 +02:00
parent 73a94fcc7c
commit aee94a761e

View file

@ -22,6 +22,7 @@ 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;
@ -73,22 +74,24 @@ 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");
}
System.out.println("++++++++++++++++++++++++++++ remove: " + lmsSetup);
this.cache.remove(new CacheKey(lmsSetup.getModelId(), 0));
}
@Override
public void cleanup() {