mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetImage.java
@Test
    public void testGetImage()
    {
        AssetCapabilities assetCaps = new AssetCapabilities();
        DigitalMedia digMedia = new DigitalMedia();
        assetCaps.setPrimaryImage(digMedia);
        
        //verify default image is returned if no capabilities for the asset
        assertThat(m_SUT.getImage(assetCaps), is(ASSET_ICON_DFLT));
        
        List<SensingModality> sensingList = new ArrayList<SensingModality>();
        SensingModality imageModality = new SensingModality();
        imageModality.setValue(SensingModalityEnum.ACOUSTIC);
        
        AssetCapabilities assetCapsSensing = mock(AssetCapabilities.class);
        when(assetCapsSensing.getModalities()).thenReturn(sensingList);
        
        //verify that if no modalities are returned the default image is returned
        assertThat(m_SUT.getImage(assetCapsSensing), is(ASSET_ICON_DFLT));
        
        sensingList.add(imageModality);
        
        //verify if no primary image and capabilities have sensing modalities the first one is returned
        //for the image
        assertThat(m_SUT.getImage(assetCapsSensing), is(ASSET_ICON_ACOUSTIC));
    }
/**
     * Verify the getImage method works as intended.
     */
Verify the getImage method works as intended.
Verify the getImage method works as intended .
@Test
    public void testGetImage()
    {
        AssetCapabilities assetCaps = new AssetCapabilities();
        DigitalMedia digMedia = new DigitalMedia();
        assetCaps.setPrimaryImage(digMedia);
        assertThat(m_SUT.getImage(assetCaps), is(ASSET_ICON_DFLT));
        List<SensingModality> sensingList = new ArrayList<SensingModality>();
        SensingModality imageModality = new SensingModality();
        imageModality.setValue(SensingModalityEnum.ACOUSTIC);
        AssetCapabilities assetCapsSensing = mock(AssetCapabilities.class);
        when(assetCapsSensing.getModalities()).thenReturn(sensingList);
        assertThat(m_SUT.getImage(assetCapsSensing), is(ASSET_ICON_DFLT));
        sensingList.add(imageModality);
        assertThat(m_SUT.getImage(assetCapsSensing), is(ASSET_ICON_ACOUSTIC));
    }
@ Test public void testGetImage ( ) { AssetCapabilities assetCaps = new AssetCapabilities ( ) ; DigitalMedia digMedia = new DigitalMedia ( ) ; assetCaps . setPrimaryImage ( digMedia ) ; assertThat ( m_SUT . getImage ( assetCaps ) , is ( ASSET_ICON_DFLT ) ) ; List < SensingModality > sensingList = new ArrayList < SensingModality > ( ) ; SensingModality imageModality = new SensingModality ( ) ; imageModality . setValue ( SensingModalityEnum . ACOUSTIC ) ; AssetCapabilities assetCapsSensing = mock ( AssetCapabilities . class ) ; when ( assetCapsSensing . getModalities ( ) ) . thenReturn ( sensingList ) ; assertThat ( m_SUT . getImage ( assetCapsSensing ) , is ( ASSET_ICON_DFLT ) ) ; sensingList . add ( imageModality ) ; assertThat ( m_SUT . getImage ( assetCapsSensing ) , is ( ASSET_ICON_ACOUSTIC ) ) ; }
Verify the getImage method works as intended.
Verify the getImage method works as intended .
//verify default image is returned if no capabilities for the asset //verify that if no modalities are returned the default image is returned //verify if no primary image and capabilities have sensing modalities the first one is returned //for the image