@Test
public void testMigration() {

    createBucket("bucket1");
    BucketEntity bucket2 = createBucket("bucket2");
    BucketEntity bucket3 = createBucket("bucket3");
    FlowEntity flow1 = createFlow(bucket2, "flow1");
    FlowEntity flow2 = createFlow(bucket3, "flow2");
    FlowEntity flow3 = createFlow(bucket3, "flow3");
    List<FlowSnapshotEntity> snapshots = Arrays.asList(
            createSnapshot(flow1, 1),
            createSnapshot(flow2, 1),
            createSnapshot(flow2, 2),
            createSnapshot(flow3, 1),
            createSnapshot(flow3, 2),
            createSnapshot(flow3, 3));
    new FlowPersistenceProviderMigrator().doMigrate(metadataService, fromProvider, toProvider);
    for (FlowSnapshotEntity snapshot : snapshots) {
        verifyMigrate(snapshot);
    }
    verifyNoMoreInteractions(toProvider);
}