mil.dod.th.ose.shell/test/mil/dod/th/ose/shell/TestPowerManagerCommands.java
@Test
    public void testGetWakeLockByContextWrongId()
    {
        Set<WakeLock> locks = getMockedWakeLocks(WakeLockState.Any);
        when(m_PowerManager.getWakeLocks(ActiveContextClass.class, WakeLockState.Any)).thenReturn(locks);
        Set<WakeLock> returnedLocks = m_SUT.getWakeLocksByContext(m_Session, 
                ActiveContextClass.class.getName(), "noId");
        verify(m_PowerManager).getWakeLocks(ActiveContextClass.class, WakeLockState.Any);
        
        assertThat(returnedLocks, notNullValue());
        assertThat(returnedLocks.size(), is(0));
        verify(m_PrintStream).format(anyString(), anyVararg());
    }
/**
     * Verify that no wakelock is returned if the id does not match.
     */
Verify that no wakelock is returned if the id does not match.
Verify that no wakelock is returned if the id does not match .
@Test
    public void testGetWakeLockByContextWrongId()
    {
        Set<WakeLock> locks = getMockedWakeLocks(WakeLockState.Any);
        when(m_PowerManager.getWakeLocks(ActiveContextClass.class, WakeLockState.Any)).thenReturn(locks);
        Set<WakeLock> returnedLocks = m_SUT.getWakeLocksByContext(m_Session, 
                ActiveContextClass.class.getName(), "noId");
        verify(m_PowerManager).getWakeLocks(ActiveContextClass.class, WakeLockState.Any);
        assertThat(returnedLocks, notNullValue());
        assertThat(returnedLocks.size(), is(0));
        verify(m_PrintStream).format(anyString(), anyVararg());
    }
@ Test public void testGetWakeLockByContextWrongId ( ) { Set < WakeLock > locks = getMockedWakeLocks ( WakeLockState . Any ) ; when ( m_PowerManager . getWakeLocks ( ActiveContextClass . class , WakeLockState . Any ) ) . thenReturn ( locks ) ; Set < WakeLock > returnedLocks = m_SUT . getWakeLocksByContext ( m_Session , ActiveContextClass . class . getName ( ) , "noId" ) ; verify ( m_PowerManager ) . getWakeLocks ( ActiveContextClass . class , WakeLockState . Any ) ; assertThat ( returnedLocks , notNullValue ( ) ) ; assertThat ( returnedLocks . size ( ) , is ( 0 ) ) ; verify ( m_PrintStream ) . format ( anyString ( ) , anyVararg ( ) ) ; }
Verify that no wakelock is returned if the id does not match.
Verify that no wakelock is returned if the id does not match .