Skip to content

Commit

Permalink
Fix missing provider
Browse files Browse the repository at this point in the history
Signed-off-by: Florent MILLOT <[email protected]>
  • Loading branch information
flomillot committed Dec 13, 2023
1 parent 7cf52ad commit 291d46e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public ResponseEntity<SensitivityAnalysisResult> run(@Parameter(description = "N
public ResponseEntity<UUID> runAndSave(@Parameter(description = "Network UUID") @PathVariable("networkUuid") UUID networkUuid,
@Parameter(description = "Variant Id") @RequestParam(name = "variantId", required = false) String variantId,
@Parameter(description = "Result receiver") @RequestParam(name = "receiver", required = false) String receiver,
@Parameter(description = "Provider") @RequestParam(name = "provider", required = false) String provider,
@Parameter(description = "Provider") @RequestParam(name = "provider", required = false, defaultValue = "OpenLoadFlow") String provider,
@Parameter(description = "reportUuid") @RequestParam(name = "reportUuid", required = false) UUID reportUuid,
@Parameter(description = "reporterId") @RequestParam(name = "reporterId", required = false) String reporterId,
@Parameter(description = "The type name for the report") @RequestParam(name = "reportType", required = false, defaultValue = "SensitivityAnalysis") String reportType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void testEmptyInputTranslation() {
.build();
ReporterModel reporter = new ReporterModel("a", "b");
SensitivityAnalysisRunContext context;
context = new SensitivityAnalysisRunContext(NETWORK_UUID, VARIANT_ID, inputData, null, null, null, null, null);
context = new SensitivityAnalysisRunContext(NETWORK_UUID, VARIANT_ID, inputData, null, "OpenLoadFlow", null, null, null);
inputBuilderService.build(context, NETWORK, reporter);
Collection<Report> reports;
reports = reporter.getReports();
Expand Down Expand Up @@ -157,7 +157,7 @@ public void testFilterPbInputTranslation() {
.contingencies(List.of(new EquipmentsContainer(UUID.randomUUID(), "u10"), new EquipmentsContainer(UUID.randomUUID(), "u11")))
.build()))
.build();
context = new SensitivityAnalysisRunContext(NETWORK_UUID, VARIANT_ID, inputData, null, null, null, null, null);
context = new SensitivityAnalysisRunContext(NETWORK_UUID, VARIANT_ID, inputData, null, "OpenLoadFlow", null, null, null);
inputBuilderService.build(context, NETWORK, reporter);
Collection<Report> reports = reporter.getReports();
assertThat(reports, not(nullValue()));
Expand All @@ -177,7 +177,7 @@ public void testFilterWiderPbInputTranslation() {

SensitivityAnalysisInputData inputData = inputBuilder
.build();
context = new SensitivityAnalysisRunContext(NETWORK_UUID, VARIANT_ID, inputData, null, null, null, null, null);
context = new SensitivityAnalysisRunContext(NETWORK_UUID, VARIANT_ID, inputData, null, "OpenLoadFlow", null, null, null);
final ReporterModel reporter = new ReporterModel("a", "b");
var thrown = assertThrows(NullPointerException.class, () -> inputBuilderService.build(context, NETWORK, reporter));
assertThat(thrown, Matchers.instanceOf(NullPointerException.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private static SensitivityAnalysisInputData getDummyInputData() {
@Test
public void test0() {
SensitivityAnalysisRunContext context = new SensitivityAnalysisRunContext(NETWORK_UUID, VARIANT_ID,
getDummyInputData(), null, null, null, null, null);
getDummyInputData(), null, "OpenLoadFlow", null, null, null);
testBasic(true, context);
testBasic(false, context);
}
Expand Down Expand Up @@ -306,7 +306,7 @@ public void testNoNKStillOK() {

UUID gottenResultUuid = analysisService.runAndSaveResult(
new SensitivityAnalysisRunContext(NETWORK_UUID, VARIANT_ID,
getDummyInputData(), null, null, null, null, null));
getDummyInputData(), null, "OpenLoadFlow", null, null, null));
assertThat(gottenResultUuid, not(nullValue()));
assertThat(gottenResultUuid, is(resultUuid));

Expand Down Expand Up @@ -378,7 +378,7 @@ private void testNoN(boolean specific) {

UUID gottenResultUuid = analysisService.runAndSaveResult(
new SensitivityAnalysisRunContext(NETWORK_UUID, VARIANT_ID,
getDummyInputData(), null, null, null, null, null));
getDummyInputData(), null, "OpenLoadFlow", null, null, null));
assertThat(gottenResultUuid, not(nullValue()));
assertThat(gottenResultUuid, is(resultUuid));

Expand Down

0 comments on commit 291d46e

Please sign in to comment.