mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testRemoteCreateAssetHandler()
    {
        //verify no assets exist for the system
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(0));

        //get a handler
        RemoteCreateAssetHandler handler = m_SUT.createRemoteAssetHandler();
        
        FactoryObjectInfo info = FactoryObjectInfo.newBuilder().
                setPid("PIDDER").
                setUuid(SharedMessageUtils.convertUUIDToProtoUUID(UUID.randomUUID())).
                setProductType(Asset.class.getName()).build();
        
        //response messages to process
        CreateAssetResponseData response1 = CreateAssetResponseData.newBuilder().
            setInfo(info).build();

        AssetDirectoryServiceNamespace nameResponse1 = AssetDirectoryServiceNamespace.newBuilder().
            setData(response1.toByteString()).
            setType(AssetDirectoryServiceMessageType.CreateAssetResponse).build();

        TerraHarvestPayload payload1 = TerraHarvestPayload.newBuilder().setNamespace(Namespace.AssetDirectoryService).
                setNamespaceMessage(nameResponse1.toByteString()).build();
        TerraHarvestMessage thMessage1 = TerraHarvestMessageHelper.
            createTerraHarvestMessage(systemId1, 0, Namespace.AssetDirectoryService, 123, nameResponse1);

        //this will load the registration ids into the response handler
        handler.handleResponse(thMessage1, payload1, nameResponse1, response1);
        
        //verify asset added
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(1));
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).get(0).getType(), is(Asset.class.getName()));
    }
/**
     * Test the handling of remote response handler for create asset requests.
     * Verify response handler sends set property request.
     * Verify that an asset model was created from the create asset response.
     */
Test the handling of remote response handler for create asset requests.
Verify response handler sends set property request.
Verify that an asset model was created from the create asset response.
Test the handling of remote response handler for create asset requests . Verify response handler sends set property request . Verify that an asset model was created from the create asset response .
@Test
    public void testRemoteCreateAssetHandler()
    {
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(0));
        RemoteCreateAssetHandler handler = m_SUT.createRemoteAssetHandler();
        FactoryObjectInfo info = FactoryObjectInfo.newBuilder().
                setPid("PIDDER").
                setUuid(SharedMessageUtils.convertUUIDToProtoUUID(UUID.randomUUID())).
                setProductType(Asset.class.getName()).build();
        CreateAssetResponseData response1 = CreateAssetResponseData.newBuilder().
            setInfo(info).build();
        AssetDirectoryServiceNamespace nameResponse1 = AssetDirectoryServiceNamespace.newBuilder().
            setData(response1.toByteString()).
            setType(AssetDirectoryServiceMessageType.CreateAssetResponse).build();
        TerraHarvestPayload payload1 = TerraHarvestPayload.newBuilder().setNamespace(Namespace.AssetDirectoryService).
                setNamespaceMessage(nameResponse1.toByteString()).build();
        TerraHarvestMessage thMessage1 = TerraHarvestMessageHelper.
            createTerraHarvestMessage(systemId1, 0, Namespace.AssetDirectoryService, 123, nameResponse1);
        handler.handleResponse(thMessage1, payload1, nameResponse1, response1);
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).size(), is(1));
        assertThat(m_SUT.getAssetsForControllerAsync(systemId1).get(0).getType(), is(Asset.class.getName()));
    }
@ Test public void testRemoteCreateAssetHandler ( ) { assertThat ( m_SUT . getAssetsForControllerAsync ( systemId1 ) . size ( ) , is ( 0 ) ) ; RemoteCreateAssetHandler handler = m_SUT . createRemoteAssetHandler ( ) ; FactoryObjectInfo info = FactoryObjectInfo . newBuilder ( ) . setPid ( "PIDDER" ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( UUID . randomUUID ( ) ) ) . setProductType ( Asset . class . getName ( ) ) . build ( ) ; CreateAssetResponseData response1 = CreateAssetResponseData . newBuilder ( ) . setInfo ( info ) . build ( ) ; AssetDirectoryServiceNamespace nameResponse1 = AssetDirectoryServiceNamespace . newBuilder ( ) . setData ( response1 . toByteString ( ) ) . setType ( AssetDirectoryServiceMessageType . CreateAssetResponse ) . build ( ) ; TerraHarvestPayload payload1 = TerraHarvestPayload . newBuilder ( ) . setNamespace ( Namespace . AssetDirectoryService ) . setNamespaceMessage ( nameResponse1 . toByteString ( ) ) . build ( ) ; TerraHarvestMessage thMessage1 = TerraHarvestMessageHelper . createTerraHarvestMessage ( systemId1 , 0 , Namespace . AssetDirectoryService , 123 , nameResponse1 ) ; handler . handleResponse ( thMessage1 , payload1 , nameResponse1 , response1 ) ; assertThat ( m_SUT . getAssetsForControllerAsync ( systemId1 ) . size ( ) , is ( 1 ) ) ; assertThat ( m_SUT . getAssetsForControllerAsync ( systemId1 ) . get ( 0 ) . getType ( ) , is ( Asset . class . getName ( ) ) ) ; }
Test the handling of remote response handler for create asset requests.
Test the handling of remote response handler for create asset requests .
//verify no assets exist for the system //get a handler //response messages to process //this will load the registration ids into the response handler //verify asset added