@Test(expected = IllegalStateException.class)
public void testCreateConnectionWhenDestGroupNotChildOfConnectionGroup() {

    final String flowId = flow.getFlowMetadata().getIdentifier();
    final String groupId = group2.getIdentifier();
    when(flowManager.getFlow(flowId)).thenReturn(Optional.of(flow));
    // Make the dest an input port in process group 1 which is not a child group of the connection group
    final ConnectableComponent newDest = ComponentUtils.createConnectableComponent(group1InputPort);
    connectionConfig.setDestination(newDest);
    connectionService.create(flowId, groupId, connectionConfig);
}