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

    when(metadataService.getFlowById(any(String.class))).thenReturn(null);
    registryService.getFlow("flow1");
}