mil.dod.th.ose.shell/test/mil/dod/th/ose/shell/TestPowerManagerCommands.java
@SuppressWarnings({"unchecked", "rawtypes"})
    @Test
    public void testDisableCommandWithProperties() throws IOException
    {
        Dictionary<String, Object> dict = new Hashtable<>();
        dict.put(PlatformPowerManager.CONFIG_PROP_ENABLED, true);
        when(m_Configuration.getProperties()).thenReturn(dict);
        
        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 a configuration exists.
     */
Verify that the platform power manager can be disabled via the configuration admin service
if a configuration exists.
Verify that the platform power manager can be disabled via the configuration admin service if a configuration exists .
@SuppressWarnings({"unchecked", "rawtypes"})
    @Test
    public void testDisableCommandWithProperties() throws IOException
    {
        Dictionary<String, Object> dict = new Hashtable<>();
        dict.put(PlatformPowerManager.CONFIG_PROP_ENABLED, true);
        when(m_Configuration.getProperties()).thenReturn(dict);
        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 ( { "unchecked" , "rawtypes" } ) @ Test public void testDisableCommandWithProperties ( ) throws IOException { Dictionary < String , Object > dict = new Hashtable < > ( ) ; dict . put ( PlatformPowerManager . CONFIG_PROP_ENABLED , true ) ; when ( m_Configuration . getProperties ( ) ) . thenReturn ( dict ) ; 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 a configuration exists.
Verify that the platform power manager can be disabled via the configuration admin service if a configuration exists .