From 5007f66ef7e2d3ed5735ff5f84e227d37dcf8e98 Mon Sep 17 00:00:00 2001
From: FranckLecuyer <47824306+FranckLecuyer@users.noreply.github.com>
Date: Mon, 29 Jul 2024 12:04:18 +0200
Subject: [PATCH] Upgrade to powsybl dependencies 2024.2.0 (#67)

Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
---
 pom.xml                                                      | 2 +-
 .../org/gridsuite/cases/importer/job/CaseAcquisitionJob.java | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5a5ad83..63bc3f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,7 +42,7 @@
     </developers>
 
     <properties>
-        <gridsuite-dependencies.version>30</gridsuite-dependencies.version>
+        <gridsuite-dependencies.version>31</gridsuite-dependencies.version>
 
         <jcraft.version>0.1.55</jcraft.version>
         <fake.sftp.server.version>2.0.1</fake.sftp.server.version>
diff --git a/src/main/java/org/gridsuite/cases/importer/job/CaseAcquisitionJob.java b/src/main/java/org/gridsuite/cases/importer/job/CaseAcquisitionJob.java
index 1ee2aaa..83e15e1 100644
--- a/src/main/java/org/gridsuite/cases/importer/job/CaseAcquisitionJob.java
+++ b/src/main/java/org/gridsuite/cases/importer/job/CaseAcquisitionJob.java
@@ -6,6 +6,7 @@
  */
 package org.gridsuite.cases.importer.job;
 
+import com.powsybl.commons.PowsyblException;
 import com.powsybl.commons.config.ModuleConfig;
 import com.powsybl.commons.config.PlatformConfig;
 import org.slf4j.Logger;
@@ -42,8 +43,8 @@ public static void main(String... args) {
     public void run(String... args) throws Exception {
         PlatformConfig platformConfig = PlatformConfig.defaultConfig();
 
-        ModuleConfig moduleConfigAcquisitionServer = platformConfig.getModuleConfig("acquisition-server");
-        ModuleConfig moduleConfigCaseServer = platformConfig.getModuleConfig("case-server");
+        ModuleConfig moduleConfigAcquisitionServer = platformConfig.getOptionalModuleConfig("acquisition-server").orElseThrow(() -> new PowsyblException("Module acquisition-server not found !!"));
+        ModuleConfig moduleConfigCaseServer = platformConfig.getOptionalModuleConfig("case-server").orElseThrow(() -> new PowsyblException("Module case-server not found !!"));
 
         final CaseImportServiceRequester caseImportServiceRequester = new CaseImportServiceRequester(moduleConfigCaseServer.getStringProperty("url"));