@Test
public void testGetDiffReturnsRemovedComponentChanges() {

    when(flowPersistenceProvider.getFlowContent(
            anyString(), anyString(), anyInt()
    )).thenReturn(new byte[10], new byte[10]);
    final VersionedProcessGroup pgA = createVersionedProcessGroupA();
    final VersionedProcessGroup pgB = createVersionedProcessGroupB();
    when(flowContentSerializer.readDataModelVersion(any(InputStream.class))).thenReturn(2);
    when(flowContentSerializer.isProcessGroupVersion(eq(2))).thenReturn(true);
    when(flowContentSerializer.deserializeProcessGroup(eq(2),any())).thenReturn(pgA, pgB);
    final VersionedFlowDifference diff = registryService.getFlowDiff(
            "bucketIdentifier", "flowIdentifier", 1, 2);
    assertNotNull(diff);
    Optional<ComponentDifferenceGroup> removedComponent = diff.getComponentDifferenceGroups().stream()
            .filter(p->p.getComponentId().equals("ID-pg1")).findFirst();
    assertTrue(removedComponent.isPresent());
    assertTrue(removedComponent.get().getDifferences().iterator().next().getDifferenceType().equals("COMPONENT_REMOVED"));
}