# JUNIT Test - Child workflow send signal to parent workflow

**URL:** <https://community.temporal.io/t/junit-test-child-workflow-send-signal-to-parent-workflow/4870>\
**Category:** Community Support\
**Tags:** java-sdk, child-workflow, signals, testing\
**Created:** [June 2, 2022, 6:57pm UTC](https://community.temporal.io/t/junit-test-child-workflow-send-signal-to-parent-workflow/4870 "2022-06-02T18:57:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avinash\_Nayak](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/avinash_nayak/32/2142_2.png) [@Avinash\_Nayak](https://community.temporal.io/u/Avinash_Nayak)\
**Post date:** [June 2, 2022, 6:57pm UTC](https://community.temporal.io/t/junit-test-child-workflow-send-signal-to-parent-workflow/4870/1 "2022-06-02T18:57:36Z")

</div>

Hi, I’m writing JUNIT test case for asserting whether a signal has been sent from child workflow to parent workflow and parent workflow doesn’t wait for signal from child workflow. How can I write test for this scenario please suggest

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [June 2, 2022, 11:15pm UTC](https://community.temporal.io/t/junit-test-child-workflow-send-signal-to-parent-workflow/4870/2 "2022-06-02T23:15:12Z")

</div>

Hi @Avinash_Nayak  
can you provide more info on “and parent workflow doesn’t wait for signal from child workflow”?

If the parent calls child async and completes before child sends the signal you  
should be able to catch ApplicationFailure in child workflow, for example:

```auto
ParentWorkflow parent =
        Workflow.newExternalWorkflowStub(ParentWorkflow.class, Workflow.getInfo().getWorkflowId());
    try {
      // setName is parent signal handler
      parent.setName("child");
    } catch (ApplicationFailure e) {
      // e should have type SignalExternalWorkflowExecutionFailedCause.SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_EXTERNAL_WORKFLOW_EXECUTION_NOT_FOUND
    }

```

and you assert that this exception was thrown in child.

If you mean that parent workflow does not handle the signal, you could in test use maybe Mockito to verify its signal handler method was called.

Let us know what you mean by this specifically and provide your workflow, child workflow code to help clear this up more.
