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