mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetModel.java
@Test
    public void testGetImage()
    {
        AssetModel model = new AssetModel(0, m_Uuid, ASSET_PID, Asset.class.getName(), 
                m_FactoryMgr, m_ConfigWrapper, m_AssetTypesMgr, m_AssetImageInterface);
        String result = model.getImage();
        assertThat(result, is(ASSET_ICON_DFLT));

        AssetFactoryModel afm = mock(AssetFactoryModel.class);
        when(afm.getFactoryCaps()).thenReturn(null);
        when(m_AssetTypesMgr.getAssetFactoryForClassAsync(anyInt(), anyString())).thenReturn(afm);
        result = model.getImage();
        assertThat(result, is(ASSET_ICON_DFLT));
        
        //Test with list size of 0
        List<SensingModality> smList = new ArrayList<SensingModality>();
        AssetCapabilities ac = mock(AssetCapabilities.class);
        when(ac.getModalities()).thenReturn(smList);
        when(afm.getFactoryCaps()).thenReturn(ac);
        result = model.getImage();

        //test with item in list
        SensingModality sm = mock(SensingModality.class);
        smList.add(sm);
        when(sm.getValue()).thenReturn(SensingModalityEnum.ACOUSTIC);
        result = model.getImage();
        assertThat(result, is(ASSET_ICON_ACOUSTIC));
    }
/**
     * Confirm that if an AssetModel has a FactoryModel with Capabilities, then the image is the first sensing modality
     * in the capabilities list, verify that if the AssetModel does not have any capabilities then the image is the 
     * default image.
     */
Confirm that if an AssetModel has a FactoryModel with Capabilities, then the image is the first sensing modality
in the capabilities list, verify that if the AssetModel does not have any capabilities then the image is the
default image.
Confirm that if an AssetModel has a FactoryModel with Capabilities then the image is the first sensing modality in the capabilities list verify that if the AssetModel does not have any capabilities then the image is the default image .
@Test
    public void testGetImage()
    {
        AssetModel model = new AssetModel(0, m_Uuid, ASSET_PID, Asset.class.getName(), 
                m_FactoryMgr, m_ConfigWrapper, m_AssetTypesMgr, m_AssetImageInterface);
        String result = model.getImage();
        assertThat(result, is(ASSET_ICON_DFLT));
        AssetFactoryModel afm = mock(AssetFactoryModel.class);
        when(afm.getFactoryCaps()).thenReturn(null);
        when(m_AssetTypesMgr.getAssetFactoryForClassAsync(anyInt(), anyString())).thenReturn(afm);
        result = model.getImage();
        assertThat(result, is(ASSET_ICON_DFLT));
        List<SensingModality> smList = new ArrayList<SensingModality>();
        AssetCapabilities ac = mock(AssetCapabilities.class);
        when(ac.getModalities()).thenReturn(smList);
        when(afm.getFactoryCaps()).thenReturn(ac);
        result = model.getImage();
        SensingModality sm = mock(SensingModality.class);
        smList.add(sm);
        when(sm.getValue()).thenReturn(SensingModalityEnum.ACOUSTIC);
        result = model.getImage();
        assertThat(result, is(ASSET_ICON_ACOUSTIC));
    }
@ Test public void testGetImage ( ) { AssetModel model = new AssetModel ( 0 , m_Uuid , ASSET_PID , Asset . class . getName ( ) , m_FactoryMgr , m_ConfigWrapper , m_AssetTypesMgr , m_AssetImageInterface ) ; String result = model . getImage ( ) ; assertThat ( result , is ( ASSET_ICON_DFLT ) ) ; AssetFactoryModel afm = mock ( AssetFactoryModel . class ) ; when ( afm . getFactoryCaps ( ) ) . thenReturn ( null ) ; when ( m_AssetTypesMgr . getAssetFactoryForClassAsync ( anyInt ( ) , anyString ( ) ) ) . thenReturn ( afm ) ; result = model . getImage ( ) ; assertThat ( result , is ( ASSET_ICON_DFLT ) ) ; List < SensingModality > smList = new ArrayList < SensingModality > ( ) ; AssetCapabilities ac = mock ( AssetCapabilities . class ) ; when ( ac . getModalities ( ) ) . thenReturn ( smList ) ; when ( afm . getFactoryCaps ( ) ) . thenReturn ( ac ) ; result = model . getImage ( ) ; SensingModality sm = mock ( SensingModality . class ) ; smList . add ( sm ) ; when ( sm . getValue ( ) ) . thenReturn ( SensingModalityEnum . ACOUSTIC ) ; result = model . getImage ( ) ; assertThat ( result , is ( ASSET_ICON_ACOUSTIC ) ) ; }
Confirm that if an AssetModel has a FactoryModel with Capabilities, then the image is the first sensing modality
 in the capabilities list, verify that if the AssetModel does not have any capabilities then the image is the
 default image.
Confirm that if an AssetModel has a FactoryModel with Capabilities then the image is the first sensing modality in the capabilities list verify that if the AssetModel does not have any capabilities then the image is the default image .
//Test with list size of 0 //test with item in list