From 94a1d6767f33e53fdc1d797702f216355917f134 Mon Sep 17 00:00:00 2001 From: David BRAQUART Date: Wed, 8 Jan 2025 12:18:14 +0100 Subject: [PATCH] add 1 test Signed-off-by: David BRAQUART --- .../server/LoadFlowRunContextTest.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/gridsuite/loadflow/server/LoadFlowRunContextTest.java b/src/test/java/org/gridsuite/loadflow/server/LoadFlowRunContextTest.java index 76b19e2..f6165b2 100644 --- a/src/test/java/org/gridsuite/loadflow/server/LoadFlowRunContextTest.java +++ b/src/test/java/org/gridsuite/loadflow/server/LoadFlowRunContextTest.java @@ -19,6 +19,8 @@ import java.util.Collections; import java.util.Map; import java.util.Optional; + +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; @@ -26,12 +28,32 @@ class LoadFlowRunContextTest { @Test void testBuildParametersWithNullParameters() { + LoadFlowParameters defaultParams = LoadFlowParameters.load(); LoadFlowRunContext context = LoadFlowRunContext.builder() .parameters(null) .build(); LoadFlowParameters params = context.buildParameters(); - assertNotNull(params); + assertThat(params) + .usingRecursiveComparison() + .isEqualTo(defaultParams); + } + + @Test + void testBuildParametersWithNullCommonParameters() { + LoadFlowParameters defaultParams = LoadFlowParameters.load(); + LoadFlowParametersValues parametersValues = LoadFlowParametersValues.builder() + .commonParameters(null) + .build(); + + LoadFlowRunContext context = LoadFlowRunContext.builder() + .parameters(parametersValues) + .build(); + + LoadFlowParameters params = context.buildParameters(); + assertThat(params) + .usingRecursiveComparison() + .isEqualTo(defaultParams); } @Test