mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/observation/TestObservationMgrImpl.java
@Test
    public void testGetModalities()
    {
        Observation obs = mock(Observation.class);
        Detection detection = mock(Detection.class);
        
        SensingModality md1 = mock(SensingModality.class);
        SensingModality md2 = mock(SensingModality.class);
        
        when(md1.getValue()).thenReturn(SensingModalityEnum.MAGNETIC);
        when(md2.getValue()).thenReturn(SensingModalityEnum.PIR);
        
        List<SensingModality> modalities = new ArrayList<SensingModality>();
        modalities.add(md1);
        modalities.add(md2);
        
        when(obs.getModalities()).thenReturn(modalities);
        when(obs.getDetection()).thenReturn(detection);
        
        List<String> answer = m_SUT.getModalities(obs);
        
        assertThat(answer.size(), is(2));
        assertThat(answer.get(0), is(SensingModalityEnum.MAGNETIC.toString().toLowerCase()));
        assertThat(answer.get(1), is(SensingModalityEnum.PIR.toString().toLowerCase()));
    }
/**
     * Verify that sensing modalities can be retrieved from a observation if 
     * it contains a detection
     */
Verify that sensing modalities can be retrieved from a observation if
it contains a detection
Verify that sensing modalities can be retrieved from a observation if it contains a detection
@Test
    public void testGetModalities()
    {
        Observation obs = mock(Observation.class);
        Detection detection = mock(Detection.class);
        SensingModality md1 = mock(SensingModality.class);
        SensingModality md2 = mock(SensingModality.class);
        when(md1.getValue()).thenReturn(SensingModalityEnum.MAGNETIC);
        when(md2.getValue()).thenReturn(SensingModalityEnum.PIR);
        List<SensingModality> modalities = new ArrayList<SensingModality>();
        modalities.add(md1);
        modalities.add(md2);
        when(obs.getModalities()).thenReturn(modalities);
        when(obs.getDetection()).thenReturn(detection);
        List<String> answer = m_SUT.getModalities(obs);
        assertThat(answer.size(), is(2));
        assertThat(answer.get(0), is(SensingModalityEnum.MAGNETIC.toString().toLowerCase()));
        assertThat(answer.get(1), is(SensingModalityEnum.PIR.toString().toLowerCase()));
    }
@ Test public void testGetModalities ( ) { Observation obs = mock ( Observation . class ) ; Detection detection = mock ( Detection . class ) ; SensingModality md1 = mock ( SensingModality . class ) ; SensingModality md2 = mock ( SensingModality . class ) ; when ( md1 . getValue ( ) ) . thenReturn ( SensingModalityEnum . MAGNETIC ) ; when ( md2 . getValue ( ) ) . thenReturn ( SensingModalityEnum . PIR ) ; List < SensingModality > modalities = new ArrayList < SensingModality > ( ) ; modalities . add ( md1 ) ; modalities . add ( md2 ) ; when ( obs . getModalities ( ) ) . thenReturn ( modalities ) ; when ( obs . getDetection ( ) ) . thenReturn ( detection ) ; List < String > answer = m_SUT . getModalities ( obs ) ; assertThat ( answer . size ( ) , is ( 2 ) ) ; assertThat ( answer . get ( 0 ) , is ( SensingModalityEnum . MAGNETIC . toString ( ) . toLowerCase ( ) ) ) ; assertThat ( answer . get ( 1 ) , is ( SensingModalityEnum . PIR . toString ( ) . toLowerCase ( ) ) ) ; }
Verify that sensing modalities can be retrieved from a observation if
 it contains a detection
Verify that sensing modalities can be retrieved from a observation if it contains a detection