org.requirementsascode.StepToBeRun Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of requirementsascodecore Show documentation
Show all versions of requirementsascodecore Show documentation
Enables you to define and run executable use case specifications, in your code.
package org.requirementsascode;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
/**
* Use an instance of this class if you want to find out the details about the
* step to be run in a custom message handler, and to trigger the system reaction.
*
* @see ModelRunner#handleWith(Consumer)
* @author b_muth
*/
public class StepToBeRun{
private Step step;
private Object message;
private Object messageToBePublished;
StepToBeRun() {
}
/**
* Triggers the system reaction of this step.
*
* @return the message returned by the system reaction that will be published
* after the message handler completes.
*/
public Object run() {
messageToBePublished = null;
messageToBePublished = runSystemReactionOfStep();
return messageToBePublished;
}
private Object runSystemReactionOfStep() {
@SuppressWarnings("unchecked")
Function
© 2015 - 2024 Weber Informatics LLC | Privacy Policy