diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/EditablePlanTest.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/EditablePlanTest.java index dbd7e4f991..625920f835 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/EditablePlanTest.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/EditablePlanTest.java @@ -198,4 +198,28 @@ public void simResultMarkedNotStaleAfterRollback_SimulateThenCommit() { assertFalse(simResults.isStale()); } + + @Test + void simulationInputDirectivesDontChange() { + plan.create( + "BiteBanana", + new DirectiveStart.Absolute(Duration.MINUTE), + Map.of("biteSize", SerializedValue.of(1)) + ); + + final var expectedDirectives = plan.directives(); + final var simResults = plan.simulate(); + + plan.create( + "GrowBanana", + new DirectiveStart.Absolute(Duration.HOUR), + Map.of( + "growingDuration", SerializedValue.of(10), + "quantity", SerializedValue.of(1) + ) + ); + + assertIterableEquals(expectedDirectives, simResults.inputDirectives()); + assertNotEquals(plan.directives(), simResults.inputDirectives()); + } }