final AbstractComponent child = generateComponent(true, true, true, null);
final AbstractComponent comp = generateComponent(true, isDirty, true, child);
// Elaborate mocking to simulate context menu activation
MCTHousing mockHousing = Mockito.mock(MCTHousing.class);
MCTContentArea mockContentArea = Mockito.mock(MCTContentArea.class);
View mockView = Mockito.mock(View.class);
ActionContextImpl mockContext = Mockito.mock(ActionContextImpl.class);
Mockito.when(mockContext.getInspectorComponent()).thenReturn(comp);
Mockito.when(mockContext.getTargetComponent()).thenReturn(comp);
Mockito.when(mockContext.getTargetHousing()).thenReturn(mockHousing);
Mockito.when(mockHousing.getContentArea()).thenReturn(mockContentArea);
Mockito.when(mockContentArea.getHousedViewManifestation()).thenReturn(mockView);
Mockito.when(mockView.getManifestedComponent()).thenReturn(comp);
// Generate a new persistence provider each time
PersistenceProvider persistence = Mockito.mock(PersistenceProvider.class);
Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(persistence);