From dc98f451fabcb05e46cc70db15d8eb781080deb5 Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 6 Jun 2024 13:59:21 +0200 Subject: [PATCH] SEBSERV-417 improved error and waning handling and logging --- .../webservice/servicelayer/lms/impl/moodle/MoodleUtils.java | 4 ++-- .../lms/impl/moodle/plugin/MoodlePluginFullIntegration.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleUtils.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleUtils.java index 9fe1ed57..66b71da5 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleUtils.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleUtils.java @@ -563,13 +563,13 @@ public abstract class MoodleUtils { @JsonIgnoreProperties(ignoreUnknown = true) public static final class FullConnectionApplyResponse { @JsonProperty("success") - public final int success; + public final boolean success; @JsonProperty("warnings") public final Collection warnings; @JsonCreator public FullConnectionApplyResponse( - @JsonProperty("success") final int success, + @JsonProperty("success") final boolean success, @JsonProperty("warnings") final Collection warnings) { this.success = success; diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginFullIntegration.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginFullIntegration.java index e56542f3..431ab754 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginFullIntegration.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginFullIntegration.java @@ -137,7 +137,7 @@ public class MoodlePluginFullIntegration implements FullLmsIntegrationAPI { response, MoodleUtils.FullConnectionApplyResponse.class); - if (fullConnectionApplyResponse.success == 0 && !fullConnectionApplyResponse.warnings.isEmpty()) { + if (!fullConnectionApplyResponse.success && !fullConnectionApplyResponse.warnings.isEmpty()) { fullConnectionApplyResponse.warnings.stream() .filter(w -> Objects.equals(w.warningcode, "connectiondoesntmatch")) .findFirst()