mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetModel.java
@Test
    public void testIsComplete()
    {
        AssetModel model = new AssetModel(0, m_Uuid, ASSET_PID, Asset.class.getName(), 
                m_FactoryMgr, m_ConfigWrapper, m_AssetTypesMgr, m_AssetImageInterface);
        
        //make sure the model is not complete
        assertThat(model.isComplete(), is(false));

        //set the name first as this will fulfill the SUPER isComplete
        model.updateName(ASSET_NAME);
        assertThat(model.getName(), is(ASSET_NAME));
        
        //make sure the model is not complete
        assertThat(model.isComplete(), is(false));

        //set the summary
        model.setSummary(SummaryStatusEnum.GOOD);
        
        //make sure the model is not complete
        assertThat(model.isComplete(), is(false));
        
        //set summary
        model.setSummaryDescription("sd");
        assertThat(model.getSummaryDescription(), is("sd"));
        
        //make sure the model is not complete
        assertThat(model.isComplete(), is(false));
        
        //set the status
        model.setActiveStatus(AssetActiveStatus.ACTIVATED);
        
        //make sure the model is not complete
        assertThat(model.isComplete(), is(false));

        //mock the capabilities
        AssetFactoryModel factoryModel = mock(AssetFactoryModel.class);
        AssetCapabilities assetCapabils = mock(AssetCapabilities.class);
        CommandCapabilities commandCapabils = mock(CommandCapabilities.class);
        
        when(m_AssetTypesMgr.getAssetFactoryForClassAsync(anyInt(), anyString())).thenReturn(factoryModel);
        when(factoryModel.getFactoryCaps()).thenReturn(assetCapabils);
        when(assetCapabils.getCommandCapabilities()).thenReturn(commandCapabils);
        
        assertThat(model.isComplete(), is(true));
    }
/**
     * Verify the asset model is complete once activated status and capabilities exists for asset model, 
     * and the asset ASSET_NAME and asset position are present.
     * Verify that the model is still considered complete even if the summary description is null/unset.
     */
Verify the asset model is complete once activated status and capabilities exists for asset model,
and the asset ASSET_NAME and asset position are present.
Verify that the model is still considered complete even if the summary description is null/unset.
Verify the asset model is complete once activated status and capabilities exists for asset model and the asset ASSET_NAME and asset position are present . Verify that the model is still considered complete even if the summary description is null / unset .
@Test
    public void testIsComplete()
    {
        AssetModel model = new AssetModel(0, m_Uuid, ASSET_PID, Asset.class.getName(), 
                m_FactoryMgr, m_ConfigWrapper, m_AssetTypesMgr, m_AssetImageInterface);
        assertThat(model.isComplete(), is(false));
        model.updateName(ASSET_NAME);
        assertThat(model.getName(), is(ASSET_NAME));
        assertThat(model.isComplete(), is(false));
        model.setSummary(SummaryStatusEnum.GOOD);
        assertThat(model.isComplete(), is(false));
        model.setSummaryDescription("sd");
        assertThat(model.getSummaryDescription(), is("sd"));
        assertThat(model.isComplete(), is(false));
        model.setActiveStatus(AssetActiveStatus.ACTIVATED);
        assertThat(model.isComplete(), is(false));
        AssetFactoryModel factoryModel = mock(AssetFactoryModel.class);
        AssetCapabilities assetCapabils = mock(AssetCapabilities.class);
        CommandCapabilities commandCapabils = mock(CommandCapabilities.class);
        when(m_AssetTypesMgr.getAssetFactoryForClassAsync(anyInt(), anyString())).thenReturn(factoryModel);
        when(factoryModel.getFactoryCaps()).thenReturn(assetCapabils);
        when(assetCapabils.getCommandCapabilities()).thenReturn(commandCapabils);
        assertThat(model.isComplete(), is(true));
    }
@ Test public void testIsComplete ( ) { AssetModel model = new AssetModel ( 0 , m_Uuid , ASSET_PID , Asset . class . getName ( ) , m_FactoryMgr , m_ConfigWrapper , m_AssetTypesMgr , m_AssetImageInterface ) ; assertThat ( model . isComplete ( ) , is ( false ) ) ; model . updateName ( ASSET_NAME ) ; assertThat ( model . getName ( ) , is ( ASSET_NAME ) ) ; assertThat ( model . isComplete ( ) , is ( false ) ) ; model . setSummary ( SummaryStatusEnum . GOOD ) ; assertThat ( model . isComplete ( ) , is ( false ) ) ; model . setSummaryDescription ( "sd" ) ; assertThat ( model . getSummaryDescription ( ) , is ( "sd" ) ) ; assertThat ( model . isComplete ( ) , is ( false ) ) ; model . setActiveStatus ( AssetActiveStatus . ACTIVATED ) ; assertThat ( model . isComplete ( ) , is ( false ) ) ; AssetFactoryModel factoryModel = mock ( AssetFactoryModel . class ) ; AssetCapabilities assetCapabils = mock ( AssetCapabilities . class ) ; CommandCapabilities commandCapabils = mock ( CommandCapabilities . class ) ; when ( m_AssetTypesMgr . getAssetFactoryForClassAsync ( anyInt ( ) , anyString ( ) ) ) . thenReturn ( factoryModel ) ; when ( factoryModel . getFactoryCaps ( ) ) . thenReturn ( assetCapabils ) ; when ( assetCapabils . getCommandCapabilities ( ) ) . thenReturn ( commandCapabils ) ; assertThat ( model . isComplete ( ) , is ( true ) ) ; }
Verify the asset model is complete once activated status and capabilities exists for asset model,
 and the asset ASSET_NAME and asset position are present.
Verify the asset model is complete once activated status and capabilities exists for asset model and the asset ASSET_NAME and asset position are present .
//make sure the model is not complete //set the name first as this will fulfill the SUPER isComplete //make sure the model is not complete //set the summary //make sure the model is not complete //set summary //make sure the model is not complete //set the status //make sure the model is not complete //mock the capabilities