mil.dod.th.ose.shell/test/mil/dod/th/ose/shell/TestPowerManagerCommands.java
@SuppressWarnings("unchecked")
    @Test
    public void testEnableCommandPPMMissing() throws IOException
    {
        Dictionary<String, Object> dict = new Hashtable<>();
        dict.put(PlatformPowerManager.CONFIG_PROP_ENABLED, false);
        when(m_Configuration.getProperties()).thenReturn(dict);
        
        m_SUT.setPlatformPowerManager(null);
        
        m_SUT.enable(m_Session);
        verify(m_ConfigurationAdmin).getConfiguration(PlatformPowerManager.CONFIG_PID, null);
        
        verify(m_Configuration).update(Mockito.any(Dictionary.class));
        
        verify(m_PrintStream).format("Warning!! The configuration property has been set to enabled "
                + "but the PlatformPowerManager is not present%n");
    }
/**
     * Verify that the correct output is printed if PPM is not present.
     */
Verify that the correct output is printed if PPM is not present.
Verify that the correct output is printed if PPM is not present .
@SuppressWarnings("unchecked")
    @Test
    public void testEnableCommandPPMMissing() throws IOException
    {
        Dictionary<String, Object> dict = new Hashtable<>();
        dict.put(PlatformPowerManager.CONFIG_PROP_ENABLED, false);
        when(m_Configuration.getProperties()).thenReturn(dict);
        m_SUT.setPlatformPowerManager(null);
        m_SUT.enable(m_Session);
        verify(m_ConfigurationAdmin).getConfiguration(PlatformPowerManager.CONFIG_PID, null);
        verify(m_Configuration).update(Mockito.any(Dictionary.class));
        verify(m_PrintStream).format("Warning!! The configuration property has been set to enabled "
                + "but the PlatformPowerManager is not present%n");
    }
@ SuppressWarnings ( "unchecked" ) @ Test public void testEnableCommandPPMMissing ( ) throws IOException { Dictionary < String , Object > dict = new Hashtable < > ( ) ; dict . put ( PlatformPowerManager . CONFIG_PROP_ENABLED , false ) ; when ( m_Configuration . getProperties ( ) ) . thenReturn ( dict ) ; m_SUT . setPlatformPowerManager ( null ) ; m_SUT . enable ( m_Session ) ; verify ( m_ConfigurationAdmin ) . getConfiguration ( PlatformPowerManager . CONFIG_PID , null ) ; verify ( m_Configuration ) . update ( Mockito . any ( Dictionary . class ) ) ; verify ( m_PrintStream ) . format ( "Warning!! The configuration property has been set to enabled " + "but the PlatformPowerManager is not present%n" ) ; }
Verify that the correct output is printed if PPM is not present.
Verify that the correct output is printed if PPM is not present .