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

    final FlowUri flowUri = new FlowUri("http://localhost:18080", UUID.randomUUID().toString(), UUID.randomUUID().toString());
    final VersionedFlowSnapshot flowSnapshot1 = FlowTestUtils.createSnapshot(flowUri.getBucketId(), flowUri.getFlowId(), 1);
    final VersionedFlowSnapshot flowSnapshot2 = FlowTestUtils.createSnapshot(flowUri.getBucketId(), flowUri.getFlowId(), 2);
    when(flowSnapshotClient.getSnapshotMetadata(flowUri.getBucketId(), flowUri.getFlowId()))
            .thenReturn(Arrays.asList(
                    flowSnapshot1.getSnapshotMetadata(),
                    flowSnapshot2.getSnapshotMetadata()));
    final List<VersionedFlowSnapshotMetadata> returnedVersions = flowRetrievalService.getVersions(flowUri);
    assertNotNull(returnedVersions);
    assertEquals(2, returnedVersions.size());
}