From a2d7e04d13a73086eff1d4c71bbd4a700d7f8fd2 Mon Sep 17 00:00:00 2001 From: Cody Hansen Date: Wed, 18 Oct 2023 08:20:22 -1000 Subject: [PATCH] Fixed some more testing code, missed this originally when simulationDatasetId was added as an optional --- .../nasa/jpl/aerie/merlin/server/mocks/StubPlanService.java | 4 ++-- .../services/ConstraintsDSLCompilationServiceTests.java | 4 ++-- .../server/services/TypescriptCodeGenerationServiceTest.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubPlanService.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubPlanService.java index c7e88a2004..94a66b0d08 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubPlanService.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubPlanService.java @@ -103,14 +103,14 @@ public void extendExternalDataset(final DatasetId datasetId, final ProfileSet pr @Override public List> getExternalDatasets( final PlanId planId, - final Optional simulationDatasetId + final SimulationDatasetId simulationDatasetId ) throws NoSuchPlanException { return List.of(); } @Override - public Map getExternalResourceSchemas(final PlanId planId) throws NoSuchPlanException { + public Map getExternalResourceSchemas(final PlanId planId, final Optional simulationDatasetId) throws NoSuchPlanException { return Map.of("external resource", ValueSchema.BOOLEAN); } diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationServiceTests.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationServiceTests.java index 134e107cb8..baaaf24846 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationServiceTests.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationServiceTests.java @@ -91,7 +91,7 @@ void tearDown() { private void checkSuccessfulCompilation(String constraint, Expression expected) { final ConstraintsDSLCompilationService.ConstraintsDSLCompilationResult result; - result = assertDoesNotThrow(() -> constraintsDSLCompilationService.compileConstraintsDSL(MISSION_MODEL_ID, Optional.of(PLAN_ID), constraint)); + result = assertDoesNotThrow(() -> constraintsDSLCompilationService.compileConstraintsDSL(MISSION_MODEL_ID, Optional.of(PLAN_ID), Optional.empty(), constraint)); if (result instanceof ConstraintsDSLCompilationService.ConstraintsDSLCompilationResult.Success r) { assertEquals(expected, r.constraintExpression()); } else if (result instanceof ConstraintsDSLCompilationService.ConstraintsDSLCompilationResult.Error r) { @@ -102,7 +102,7 @@ private void checkSuccessfulCompilation(String constraint, Expression exp private void checkFailedCompilation(String constraint, String error) { final ConstraintsDSLCompilationService.ConstraintsDSLCompilationResult.Error actualErrors; actualErrors = (ConstraintsDSLCompilationService.ConstraintsDSLCompilationResult.Error) assertDoesNotThrow(() -> constraintsDSLCompilationService.compileConstraintsDSL( - MISSION_MODEL_ID, Optional.of(PLAN_ID), constraint + MISSION_MODEL_ID, Optional.of(PLAN_ID), Optional.empty(), constraint )); if (actualErrors.errors() .stream() diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceTest.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceTest.java index de5f7d0487..1418f8f7e4 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceTest.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceTest.java @@ -15,7 +15,7 @@ class TypescriptCodeGenerationServiceTest { @Test void testCodeGen() throws MissionModelService.NoSuchMissionModelException, NoSuchPlanException { final var codeGenService = new TypescriptCodeGenerationServiceAdapter(new StubMissionModelService(), new StubPlanService()); - final var expected = codeGenService.generateTypescriptTypes("abc", Optional.of(new PlanId(1L))); + final var expected = codeGenService.generateTypescriptTypes("abc", Optional.of(new PlanId(1L)), Optional.empty()); assertEquals(expected, """ /** Start Codegen */