mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/persistence/TestObservationStoreImpl.java
@Test
    public final void testPersistChem() throws IllegalArgumentException, PersistenceFailedException, 
        ValidationFailedException
    {
        //observation to persist
        Observation obs =  createObsWithReqFields();
        obs.setChemical(new Chemical());
        
        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.CHEMICAL.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 testPersistChem() throws IllegalArgumentException, PersistenceFailedException, 
        ValidationFailedException
    {
        Observation obs =  createObsWithReqFields();
        obs.setChemical(new Chemical());
        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.CHEMICAL.toString()));
        verify(m_WakeLock, times(2)).activate();
        verify(m_WakeLock, times(2)).cancel();
    }
@ Test public final void testPersistChem ( ) throws IllegalArgumentException , PersistenceFailedException , ValidationFailedException { Observation obs = createObsWithReqFields ( ) ; obs . setChemical ( new Chemical ( ) ) ; 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 . CHEMICAL . 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