Skip to content

Commit

Permalink
add 1 test
Browse files Browse the repository at this point in the history
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
  • Loading branch information
dbraquart committed Jan 8, 2025
1 parent 313b78e commit 94a1d67
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,41 @@
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.*;

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
Expand Down

0 comments on commit 94a1d67

Please sign in to comment.