mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/observation/TestObservationMgrImpl.java
@Test
    public void testGetTargetClassifications()
    {
        Observation obs = mock(Observation.class);
        Detection detection = mock(Detection.class);
        
        TargetClassification tgt1 = mock(TargetClassification.class);
        TargetClassification tgt2 = mock(TargetClassification.class);
        
        TargetClassificationType t1Type = mock(TargetClassificationType.class);
        TargetClassificationType t2Type = mock(TargetClassificationType.class);
        
        when(tgt1.getType()).thenReturn(t1Type);
        when(tgt2.getType()).thenReturn(t2Type);
        
        when(t1Type.getValue()).thenReturn(TargetClassificationTypeEnum.ANIMAL);
        when(t2Type.getValue()).thenReturn(TargetClassificationTypeEnum.BLAST);
        
        List<TargetClassification> list = new ArrayList<TargetClassification>();
        list.add(tgt1);
        list.add(tgt2);
        
        when(detection.getTargetClassifications()).thenReturn(list);
        
        when(obs.getDetection()).thenReturn(detection);
        
        List<String> answer = m_SUT.getTargetClassifications(obs);
        
        assertThat(answer.size(), is(2));
        assertThat(answer.get(0), is(TargetClassificationTypeEnum.ANIMAL.toString().toLowerCase()));
        assertThat(answer.get(1), is(TargetClassificationTypeEnum.BLAST.toString().toLowerCase()));
    }
/**
     * Verify that target classifications can be retrieved from a 
     * observation if it contains a detection
     */
Verify that target classifications can be retrieved from a
observation if it contains a detection
Verify that target classifications can be retrieved from a observation if it contains a detection
@Test
    public void testGetTargetClassifications()
    {
        Observation obs = mock(Observation.class);
        Detection detection = mock(Detection.class);
        TargetClassification tgt1 = mock(TargetClassification.class);
        TargetClassification tgt2 = mock(TargetClassification.class);
        TargetClassificationType t1Type = mock(TargetClassificationType.class);
        TargetClassificationType t2Type = mock(TargetClassificationType.class);
        when(tgt1.getType()).thenReturn(t1Type);
        when(tgt2.getType()).thenReturn(t2Type);
        when(t1Type.getValue()).thenReturn(TargetClassificationTypeEnum.ANIMAL);
        when(t2Type.getValue()).thenReturn(TargetClassificationTypeEnum.BLAST);
        List<TargetClassification> list = new ArrayList<TargetClassification>();
        list.add(tgt1);
        list.add(tgt2);
        when(detection.getTargetClassifications()).thenReturn(list);
        when(obs.getDetection()).thenReturn(detection);
        List<String> answer = m_SUT.getTargetClassifications(obs);
        assertThat(answer.size(), is(2));
        assertThat(answer.get(0), is(TargetClassificationTypeEnum.ANIMAL.toString().toLowerCase()));
        assertThat(answer.get(1), is(TargetClassificationTypeEnum.BLAST.toString().toLowerCase()));
    }
@ Test public void testGetTargetClassifications ( ) { Observation obs = mock ( Observation . class ) ; Detection detection = mock ( Detection . class ) ; TargetClassification tgt1 = mock ( TargetClassification . class ) ; TargetClassification tgt2 = mock ( TargetClassification . class ) ; TargetClassificationType t1Type = mock ( TargetClassificationType . class ) ; TargetClassificationType t2Type = mock ( TargetClassificationType . class ) ; when ( tgt1 . getType ( ) ) . thenReturn ( t1Type ) ; when ( tgt2 . getType ( ) ) . thenReturn ( t2Type ) ; when ( t1Type . getValue ( ) ) . thenReturn ( TargetClassificationTypeEnum . ANIMAL ) ; when ( t2Type . getValue ( ) ) . thenReturn ( TargetClassificationTypeEnum . BLAST ) ; List < TargetClassification > list = new ArrayList < TargetClassification > ( ) ; list . add ( tgt1 ) ; list . add ( tgt2 ) ; when ( detection . getTargetClassifications ( ) ) . thenReturn ( list ) ; when ( obs . getDetection ( ) ) . thenReturn ( detection ) ; List < String > answer = m_SUT . getTargetClassifications ( obs ) ; assertThat ( answer . size ( ) , is ( 2 ) ) ; assertThat ( answer . get ( 0 ) , is ( TargetClassificationTypeEnum . ANIMAL . toString ( ) . toLowerCase ( ) ) ) ; assertThat ( answer . get ( 1 ) , is ( TargetClassificationTypeEnum . BLAST . toString ( ) . toLowerCase ( ) ) ) ; }
Verify that target classifications can be retrieved from a
 observation if it contains a detection
Verify that target classifications can be retrieved from a observation if it contains a detection