mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/persistence/TestObservationStoreImpl.java
@Test
    public final void testPersistPower() throws IllegalArgumentException, PersistenceFailedException, 
        ValidationFailedException
    {
        //observation to persist
        Observation obs = createObsWithReqFields();
        obs.setPower(new Power());
        
        m_SUT.persist(obs);
        
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, times(2)).postEvent(eventCaptor.capture());
        
        assertThat((String)eventCaptor.getValue().getProperty(ObservationStore.EVENT_PROP_OBSERVATION_TYPE), 
                is(ObservationSubTypeEnum.POWER.toString()));
        verify(m_WakeLock, times(2)).activate();
        verify(m_WakeLock, times(2)).cancel();
    }
/**
     * Verify that after an observation is persisted that an event is posted containing the correct 
     * observation sub type.
     */
Verify that after an observation is persisted that an event is posted containing the correct
observation sub type.
Verify that after an observation is persisted that an event is posted containing the correct observation sub type .
@Test
    public final void testPersistPower() throws IllegalArgumentException, PersistenceFailedException, 
        ValidationFailedException
    {
        Observation obs = createObsWithReqFields();
        obs.setPower(new Power());
        m_SUT.persist(obs);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin, times(2)).postEvent(eventCaptor.capture());
        assertThat((String)eventCaptor.getValue().getProperty(ObservationStore.EVENT_PROP_OBSERVATION_TYPE), 
                is(ObservationSubTypeEnum.POWER.toString()));
        verify(m_WakeLock, times(2)).activate();
        verify(m_WakeLock, times(2)).cancel();
    }
@ Test public final void testPersistPower ( ) throws IllegalArgumentException , PersistenceFailedException , ValidationFailedException { Observation obs = createObsWithReqFields ( ) ; obs . setPower ( new Power ( ) ) ; m_SUT . persist ( obs ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin , times ( 2 ) ) . postEvent ( eventCaptor . capture ( ) ) ; assertThat ( ( String ) eventCaptor . getValue ( ) . getProperty ( ObservationStore . EVENT_PROP_OBSERVATION_TYPE ) , is ( ObservationSubTypeEnum . POWER . toString ( ) ) ) ; verify ( m_WakeLock , times ( 2 ) ) . activate ( ) ; verify ( m_WakeLock , times ( 2 ) ) . cancel ( ) ; }
Verify that after an observation is persisted that an event is posted containing the correct
 observation sub type.
Verify that after an observation is persisted that an event is posted containing the correct observation sub type .
//observation to persist