sample code structure of my project is pasted below. please provide me github repo for reference
- How write test cases for workflows that contains → initiates child workflow. waits on signal from other activities.
public class Workflow1Impl implements Workflow1 {
private final Activity1 activity1 = Workflow.newActivityStub();
private WorkflowStatus workflowStatus;
// Workflow method
Public string startWorkflow( requestDto) {
try {
activit1.doActivityMethod1(requestDto)
} catch(ActivityFailure e) { }
workflow.await( workflowStatus -> signalFromActivity2 );
// initiates child workflow
return “Success”;
}
}
public class Workflow2Impl implements Workflow2 {
private final Activity2 activity2= Workflow.newActivityStub();
private WorkflowStatus workflowStatus;
// Workflow method
Public void startWorkflow( requestDto) {
try {
activit2.doActivityMethod2(requestDto)
} catch(ActivityFailure e) { }
signal to workflow1 to continue
}
}
Public class Activity1Impl implements Activity1 {
@Autowired TestClient1 client1;
@Autowired TestRepository1 testRepository1;
void doActivityMethod1() {
client1.doSomething()
testRepository1.save();
}
}