@Test
public void testRetrieveSpecificWhenVersionsExist() throws IOException, FlowRetrievalException, NiFiRegistryException {

    final FlowUri flowUri = new FlowUri("http://localhost:18080", UUID.randomUUID().toString(), UUID.randomUUID().toString());
    final int version = 2;
    final VersionedFlowSnapshot flowSnapshot = FlowTestUtils.createSnapshot(flowUri.getBucketId(), flowUri.getFlowId(), version);
    when(flowSnapshotClient.get(flowUri.getBucketId(), flowUri.getFlowId(), version)).thenReturn(flowSnapshot);
    final VersionedFlowSnapshot returnedFlowSnapshot = flowRetrievalService.getFlow(flowUri, version);
    assertNotNull(returnedFlowSnapshot);
    assertEquals(flowSnapshot.getSnapshotMetadata().getBucketIdentifier(), returnedFlowSnapshot.getSnapshotMetadata().getBucketIdentifier());
    assertEquals(flowSnapshot.getSnapshotMetadata().getFlowIdentifier(), returnedFlowSnapshot.getSnapshotMetadata().getFlowIdentifier());
    assertEquals(flowSnapshot.getSnapshotMetadata().getVersion(), returnedFlowSnapshot.getSnapshotMetadata().getVersion());
}