@Test public void twoSequentialStepsReactWhenOneIsUserStepAndOtherIsSystemStep() { Model model = modelBuilder .useCase(USE_CASE) .basicFlow() .step(CUSTOMER_ENTERS_TEXT).user(EntersText.class) .step(SYSTEM_DISPLAYS_TEXT).system(displaysConstantText()) .build(); Optional<Step> latestStepRun = modelRunner.run(model).reactTo(entersText()); assertTrue(latestStepRun.map(step -> step.getName().equals(SYSTEM_DISPLAYS_TEXT)).orElse(false)); assertRecordedStepNames(CUSTOMER_ENTERS_TEXT, SYSTEM_DISPLAYS_TEXT); }
.step("S3").as(firstActor).user(entersName()).system(greetsUser()).reactWhile(someConditionIsFulfilled()) .step("S4").as(firstActor, secondActor).user(decidesToQuit()) .step("S5").as(firstActor, secondActor).system(promptsUserToEnterName()) .step("S6").system(quits()) .flow("Alternative flow A").insteadOf("S4")