mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetImageService.java
@Test
    public void testTryGetImageKnownModel()
    {
        ControllerModel model = mock(ControllerModel.class);
        when(m_ActiveController.getActiveController()).thenReturn(model);
        when(model.getId()).thenReturn(SYSTEM_ID);
        when(m_ActiveController.isActiveControllerSet()).thenReturn(true);
        
        UUID assetUuid = UUID.randomUUID();
        AssetModel assetModel = mock(AssetModel.class);
        when(assetModel.getImage()).thenReturn("pic");
        when(m_AssetManager.getAssetModelByUuid(assetUuid, SYSTEM_ID)).
            thenReturn(assetModel);
        
        String image = m_SUT.tryGetAssetImage(assetUuid);
        
        assertThat(image, is("pic"));
    }
/**
     * Verify tryGetImage, will return an image string, from the asset model,
     * if the asset uuid is known.
     */
Verify tryGetImage, will return an image string, from the asset model,
if the asset uuid is known.
Verify tryGetImage will return an image string from the asset model if the asset uuid is known .
@Test
    public void testTryGetImageKnownModel()
    {
        ControllerModel model = mock(ControllerModel.class);
        when(m_ActiveController.getActiveController()).thenReturn(model);
        when(model.getId()).thenReturn(SYSTEM_ID);
        when(m_ActiveController.isActiveControllerSet()).thenReturn(true);
        UUID assetUuid = UUID.randomUUID();
        AssetModel assetModel = mock(AssetModel.class);
        when(assetModel.getImage()).thenReturn("pic");
        when(m_AssetManager.getAssetModelByUuid(assetUuid, SYSTEM_ID)).
            thenReturn(assetModel);
        String image = m_SUT.tryGetAssetImage(assetUuid);
        assertThat(image, is("pic"));
    }
@ Test public void testTryGetImageKnownModel ( ) { ControllerModel model = mock ( ControllerModel . class ) ; when ( m_ActiveController . getActiveController ( ) ) . thenReturn ( model ) ; when ( model . getId ( ) ) . thenReturn ( SYSTEM_ID ) ; when ( m_ActiveController . isActiveControllerSet ( ) ) . thenReturn ( true ) ; UUID assetUuid = UUID . randomUUID ( ) ; AssetModel assetModel = mock ( AssetModel . class ) ; when ( assetModel . getImage ( ) ) . thenReturn ( "pic" ) ; when ( m_AssetManager . getAssetModelByUuid ( assetUuid , SYSTEM_ID ) ) . thenReturn ( assetModel ) ; String image = m_SUT . tryGetAssetImage ( assetUuid ) ; assertThat ( image , is ( "pic" ) ) ; }
Verify tryGetImage, will return an image string, from the asset model,
 if the asset uuid is known.
Verify tryGetImage will return an image string from the asset model if the asset uuid is known .