mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetTypesMgrImpl.java
@Test
    public void testGetAssetTypesUpdate()
    {
        //load assets for system id
        Event getTypes = mockMessageGetAssetTypesResponse(systemId1);
        
        //this should render two asset types for the system id
        m_AssetHelper.handleEvent(getTypes);
        
        assertThat(m_SUT.getAssetFactoriesForControllerAsync(systemId1).size(), is(2));
        
        //collect all the names
        Set<String> types = new HashSet<String>();
        for (AssetFactoryModel model : m_SUT.getAssetFactoriesForControllerAsync(systemId1))
        {
            types.add(model.getFullyQualifiedAssetType());
        }
        //verify the FQCNs were found
        assertThat(types, hasItem("super.awesome.OutOfThisWorld"));
        assertThat(types, hasItem("sometimes.youfeellikeanut.SometimesYouDont"));
        
        //update
        getTypes = mockMessageGetAssetTypesUpdateResponse(systemId1);
        m_AssetHelper.handleEvent(getTypes);

        assertThat(m_SUT.getAssetFactoriesForControllerAsync(systemId1).size(), is(4));
        
        //collect all the names
        types = new HashSet<String>();
        for (AssetFactoryModel model : m_SUT.getAssetFactoriesForControllerAsync(systemId1))
        {
            types.add(model.getFullyQualifiedAssetType());
        }
        //verify the FQCNs were found
        assertThat(types, hasItem("super.amazing.Stuff"));
        assertThat(types, hasItem("bza.ret.plkjds"));
    }
/**
     * Test the handling of the get asset types when types already existed.
     * Verify that the product types are correctly updated.
     */
Test the handling of the get asset types when types already existed.
Verify that the product types are correctly updated.
Test the handling of the get asset types when types already existed . Verify that the product types are correctly updated .
@Test
    public void testGetAssetTypesUpdate()
    {
        Event getTypes = mockMessageGetAssetTypesResponse(systemId1);
        m_AssetHelper.handleEvent(getTypes);
        assertThat(m_SUT.getAssetFactoriesForControllerAsync(systemId1).size(), is(2));
        Set<String> types = new HashSet<String>();
        for (AssetFactoryModel model : m_SUT.getAssetFactoriesForControllerAsync(systemId1))
        {
            types.add(model.getFullyQualifiedAssetType());
        }
        assertThat(types, hasItem("super.awesome.OutOfThisWorld"));
        assertThat(types, hasItem("sometimes.youfeellikeanut.SometimesYouDont"));
        getTypes = mockMessageGetAssetTypesUpdateResponse(systemId1);
        m_AssetHelper.handleEvent(getTypes);
        assertThat(m_SUT.getAssetFactoriesForControllerAsync(systemId1).size(), is(4));
        types = new HashSet<String>();
        for (AssetFactoryModel model : m_SUT.getAssetFactoriesForControllerAsync(systemId1))
        {
            types.add(model.getFullyQualifiedAssetType());
        }
        assertThat(types, hasItem("super.amazing.Stuff"));
        assertThat(types, hasItem("bza.ret.plkjds"));
    }
@ Test public void testGetAssetTypesUpdate ( ) { Event getTypes = mockMessageGetAssetTypesResponse ( systemId1 ) ; m_AssetHelper . handleEvent ( getTypes ) ; assertThat ( m_SUT . getAssetFactoriesForControllerAsync ( systemId1 ) . size ( ) , is ( 2 ) ) ; Set < String > types = new HashSet < String > ( ) ; for ( AssetFactoryModel model : m_SUT . getAssetFactoriesForControllerAsync ( systemId1 ) ) { types . add ( model . getFullyQualifiedAssetType ( ) ) ; } assertThat ( types , hasItem ( "super.awesome.OutOfThisWorld" ) ) ; assertThat ( types , hasItem ( "sometimes.youfeellikeanut.SometimesYouDont" ) ) ; getTypes = mockMessageGetAssetTypesUpdateResponse ( systemId1 ) ; m_AssetHelper . handleEvent ( getTypes ) ; assertThat ( m_SUT . getAssetFactoriesForControllerAsync ( systemId1 ) . size ( ) , is ( 4 ) ) ; types = new HashSet < String > ( ) ; for ( AssetFactoryModel model : m_SUT . getAssetFactoriesForControllerAsync ( systemId1 ) ) { types . add ( model . getFullyQualifiedAssetType ( ) ) ; } assertThat ( types , hasItem ( "super.amazing.Stuff" ) ) ; assertThat ( types , hasItem ( "bza.ret.plkjds" ) ) ; }
Test the handling of the get asset types when types already existed.
Test the handling of the get asset types when types already existed .
//load assets for system id //this should render two asset types for the system id //collect all the names //verify the FQCNs were found //update //collect all the names //verify the FQCNs were found