mil.dod.th.ose.shell/test/mil/dod/th/ose/shell/TestPowerManagerCommands.java
@SuppressWarnings({"rawtypes", "unchecked"})
    @Test
    public void testDisableCommandWithNoProperties() throws IOException
    {
        when(m_Configuration.getProperties()).thenReturn(null);
        
        m_SUT.disable(m_Session);
        verify(m_ConfigurationAdmin).getConfiguration(PlatformPowerManager.CONFIG_PID, null);
        
        ArgumentCaptor<Dictionary> mapCaptor = ArgumentCaptor.forClass(Dictionary.class);
        verify(m_Configuration).update(mapCaptor.capture());
        
        Dictionary<String, Object> capDict = mapCaptor.getValue();
        assertThat(capDict, notNullValue());
        assertThat((boolean)capDict.get(PlatformPowerManager.CONFIG_PROP_ENABLED), is(false));
    }
/**
     * Verify that the platform power manager can be disabled via the configuration admin service
     * if no configuration already exists.
     */
Verify that the platform power manager can be disabled via the configuration admin service
if no configuration already exists.
Verify that the platform power manager can be disabled via the configuration admin service if no configuration already exists .
@SuppressWarnings({"rawtypes", "unchecked"})
    @Test
    public void testDisableCommandWithNoProperties() throws IOException
    {
        when(m_Configuration.getProperties()).thenReturn(null);
        m_SUT.disable(m_Session);
        verify(m_ConfigurationAdmin).getConfiguration(PlatformPowerManager.CONFIG_PID, null);
        ArgumentCaptor<Dictionary> mapCaptor = ArgumentCaptor.forClass(Dictionary.class);
        verify(m_Configuration).update(mapCaptor.capture());
        Dictionary<String, Object> capDict = mapCaptor.getValue();
        assertThat(capDict, notNullValue());
        assertThat((boolean)capDict.get(PlatformPowerManager.CONFIG_PROP_ENABLED), is(false));
    }
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) @ Test public void testDisableCommandWithNoProperties ( ) throws IOException { when ( m_Configuration . getProperties ( ) ) . thenReturn ( null ) ; m_SUT . disable ( m_Session ) ; verify ( m_ConfigurationAdmin ) . getConfiguration ( PlatformPowerManager . CONFIG_PID , null ) ; ArgumentCaptor < Dictionary > mapCaptor = ArgumentCaptor . forClass ( Dictionary . class ) ; verify ( m_Configuration ) . update ( mapCaptor . capture ( ) ) ; Dictionary < String , Object > capDict = mapCaptor . getValue ( ) ; assertThat ( capDict , notNullValue ( ) ) ; assertThat ( ( boolean ) capDict . get ( PlatformPowerManager . CONFIG_PROP_ENABLED ) , is ( false ) ) ; }
Verify that the platform power manager can be disabled via the configuration admin service
 if no configuration already exists.
Verify that the platform power manager can be disabled via the configuration admin service if no configuration already exists .