mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/asset/TestAssetRegistryCallback.java
@Test
    public void testPostObjectInitialize() throws FactoryException, AssetException
    {
        AssetInternal mockAsset = mock(AssetInternal.class);
        
        AssetAttributes attrs = mock(AssetAttributes.class);
        when(mockAsset.getConfig()).thenReturn(attrs);
        when(attrs.activateOnStartup()).thenReturn(true);
        String name = "name";
        when(mockAsset.getName()).thenReturn(name);
        when(registry.isObjectCreated(name)).thenReturn(false);
        when(mockAsset.getActiveStatus()).thenReturn(AssetActiveStatus.DEACTIVATED);
        
        m_SUT.postObjectInitialize(mockAsset);

        verify(mockAsset).activateAsync();
    }
/**
     * Verify checking if a new object should be activated at startup.
     */
Verify checking if a new object should be activated at startup.
Verify checking if a new object should be activated at startup .
@Test
    public void testPostObjectInitialize() throws FactoryException, AssetException
    {
        AssetInternal mockAsset = mock(AssetInternal.class);
        AssetAttributes attrs = mock(AssetAttributes.class);
        when(mockAsset.getConfig()).thenReturn(attrs);
        when(attrs.activateOnStartup()).thenReturn(true);
        String name = "name";
        when(mockAsset.getName()).thenReturn(name);
        when(registry.isObjectCreated(name)).thenReturn(false);
        when(mockAsset.getActiveStatus()).thenReturn(AssetActiveStatus.DEACTIVATED);
        m_SUT.postObjectInitialize(mockAsset);
        verify(mockAsset).activateAsync();
    }
@ Test public void testPostObjectInitialize ( ) throws FactoryException , AssetException { AssetInternal mockAsset = mock ( AssetInternal . class ) ; AssetAttributes attrs = mock ( AssetAttributes . class ) ; when ( mockAsset . getConfig ( ) ) . thenReturn ( attrs ) ; when ( attrs . activateOnStartup ( ) ) . thenReturn ( true ) ; String name = "name" ; when ( mockAsset . getName ( ) ) . thenReturn ( name ) ; when ( registry . isObjectCreated ( name ) ) . thenReturn ( false ) ; when ( mockAsset . getActiveStatus ( ) ) . thenReturn ( AssetActiveStatus . DEACTIVATED ) ; m_SUT . postObjectInitialize ( mockAsset ) ; verify ( mockAsset ) . activateAsync ( ) ; }
Verify checking if a new object should be activated at startup.
Verify checking if a new object should be activated at startup .