    @SuppressWarnings("unchecked")
    @Test
    public void signalCalled() throws Exception {

        Exchange exchange = mock(Exchange.class);
        Message message = mock(Message.class);
        ExecutionQuery query = mock(ExecutionQuery.class);
        Execution execution = mock(Execution.class);

        when(exchange.getIn()).thenReturn(message);
        when(exchange.getProperty(eq(EXCHANGE_HEADER_PROCESS_INSTANCE_ID), eq(String.class))).thenReturn(
                "theProcessInstanceId");
        when(runtimeService.createExecutionQuery()).thenReturn(query);
        when(query.processInstanceId(anyString())).thenReturn(query);
        when(query.activityId(anyString())).thenReturn(query);
        when(query.singleResult()).thenReturn(execution);
        when(execution.getId()).thenReturn("1234");

        CamundaBpmEndpoint endpoint = (CamundaBpmEndpoint) camelContext.getEndpoint(
                camundaBpmUri("message?" + ACTIVITY_ID_PARAMETER + "=" + "anActivityId"));
        Producer producer = endpoint.createProducer();

        producer.process(exchange);

        verify(runtimeService).signal(anyString(), anyMap());
    }