@Test(expected = ResourceNotFoundException.class)
public void testCreateConnectionSameGroupFlowNotFound() {

    final String flowId = flow.getFlowMetadata().getIdentifier();
    final String groupId = group2.getIdentifier();
    when(flowManager.getFlow(flowId)).thenReturn(Optional.empty());
    connectionService.create(flowId, groupId, connectionConfig);
}