### Question:
ComponentScriptService implements ScriptService { @Deprecated public ComponentManager getComponentManager() { return this.bridge.hasProgrammingRights() ? this.contextrootComponentManagerProvider.get() : null; }  @Deprecated ComponentManager getComponentManager(); ComponentManager getContextComponentManager(); ComponentManager getRootComponentManager(); ComponentManager getComponentManager(String namespace); T getInstance(Type roleType); T getInstance(Type roleType, String roleHint); Exception getLastError();  }### Answer:
@Test public void getComponentManagerWhenNoProgrammingRights() throws Exception { when(this.dab.hasProgrammingRights()).thenReturn(false); assertNull(this.mocker.getComponentUnderTest().getComponentManager()); }
@Test public void getComponentManagerWhenProgrammingRights() throws Exception { when(this.dab.hasProgrammingRights()).thenReturn(true); assertSame(this.contextrootComponentManager, this.mocker.getComponentUnderTest().getComponentManager()); }
@Test public void getComponentManagerForNamespaceWhenProgrammingRights() throws Exception { when(this.dab.hasProgrammingRights()).thenReturn(true); ComponentManager wikiComponentManager = mock(ComponentManager.class); when(this.componentManagerManager.getComponentManager("wiki:chess", false)).thenReturn(wikiComponentManager); assertSame(wikiComponentManager, this.mocker.getComponentUnderTest().getComponentManager("wiki:chess")); }