Skip to content

Commit

Permalink
Fixed some more testing code, missed this originally when simulationD…
Browse files Browse the repository at this point in the history
…atasetId was added as an optional
  • Loading branch information
cohansen committed Oct 18, 2023
1 parent 1d994cc commit a2d7e04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ public void extendExternalDataset(final DatasetId datasetId, final ProfileSet pr
@Override
public List<Pair<Duration, ProfileSet>> getExternalDatasets(
final PlanId planId,
final Optional<SimulationDatasetId> simulationDatasetId
final SimulationDatasetId simulationDatasetId
) throws NoSuchPlanException
{
return List.of();
}

@Override
public Map<String, ValueSchema> getExternalResourceSchemas(final PlanId planId) throws NoSuchPlanException {
public Map<String, ValueSchema> getExternalResourceSchemas(final PlanId planId, final Optional<SimulationDatasetId> simulationDatasetId) throws NoSuchPlanException {
return Map.of("external resource", ValueSchema.BOOLEAN);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void tearDown() {
private <T> void checkSuccessfulCompilation(String constraint, Expression<T> 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) {
Expand All @@ -102,7 +102,7 @@ private <T> void checkSuccessfulCompilation(String constraint, Expression<T> 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit a2d7e04

Please sign in to comment.