@Test
public void testPluginRenamed() {

    NavTree tree = TEST_NAV_TREE.cloneTree();
    List<NavItem> items = tree.searchItems(NavWorkbenchCtx.perspective(PERSPECTIVE_ID));
    assertThat((items).get(0).getName()).isEqualTo("name1");
    assertThat((items).get(0).getContext()).contains("resourceId=" + PERSPECTIVE_ID);
    when(navigationManager.getNavTree()).thenReturn(tree);
    testedPluginManager.onPlugInRenamed(pluginRenamedEvent);
    assertThat(tree.searchItems(NavWorkbenchCtx.perspective(PERSPECTIVE_ID))).isEmpty();
    assertThat(tree.searchItems(NavWorkbenchCtx.perspective(perspectiveRenamedPlugin.getName())).get(0).getContext()).contains("resourceId=" + perspectiveRenamedPlugin.getName());
    ArgumentCaptor<Command> argumentCaptor = ArgumentCaptor.forClass(Command.class);
    verify(navigationManager, times(1)).saveNavTree(anyObject(), argumentCaptor.capture());
    verify(perspectiveChangedEvent).fire(anyObject());
}