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

    final VersionedFlow versionedFlow = new VersionedFlow();
    versionedFlow.setBucketIdentifier("b1");
    versionedFlow.setIdentifier("flow1");
    when(metadataService.getFlowById(versionedFlow.getIdentifier())).thenReturn(null);
    registryService.updateFlow(versionedFlow);
}