mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/asset/TestAssetMessageService.java
@Test
    public void testRemoveAssetResponse() throws IOException
    {
        AssetNamespace assetDirectoryMessage = AssetNamespace.newBuilder().
                setType(AssetMessageType.DeleteResponse).
                build();
        
        TerraHarvestPayload payload = createPayload(assetDirectoryMessage);
        TerraHarvestMessage message = createMessage(assetDirectoryMessage);
        
        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);
        
        // replay
        m_SUT.handleMessage(message, payload, channel);
        
        // verify the event contains the null data message
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        
        Event event = eventCaptor.getValue();
        assertThat(event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(nullValue()));
        assertThat((String)event.getProperty(RemoteConstants.EVENT_PROP_MESSAGE_TYPE), 
                is(AssetMessageType.DeleteResponse.toString()));
    }
/**
     * Verify the remove asset response message sends an event with null data message.
     */
Verify the remove asset response message sends an event with null data message.
Verify the remove asset response message sends an event with null data message .
@Test
    public void testRemoveAssetResponse() throws IOException
    {
        AssetNamespace assetDirectoryMessage = AssetNamespace.newBuilder().
                setType(AssetMessageType.DeleteResponse).
                build();
        TerraHarvestPayload payload = createPayload(assetDirectoryMessage);
        TerraHarvestMessage message = createMessage(assetDirectoryMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        m_SUT.handleMessage(message, payload, channel);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(eventCaptor.capture());
        Event event = eventCaptor.getValue();
        assertThat(event.getProperty(RemoteConstants.EVENT_PROP_DATA_MESSAGE),
                is(nullValue()));
        assertThat((String)event.getProperty(RemoteConstants.EVENT_PROP_MESSAGE_TYPE), 
                is(AssetMessageType.DeleteResponse.toString()));
    }
@ Test public void testRemoveAssetResponse ( ) throws IOException { AssetNamespace assetDirectoryMessage = AssetNamespace . newBuilder ( ) . setType ( AssetMessageType . DeleteResponse ) . build ( ) ; TerraHarvestPayload payload = createPayload ( assetDirectoryMessage ) ; TerraHarvestMessage message = createMessage ( assetDirectoryMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; m_SUT . handleMessage ( message , payload , channel ) ; ArgumentCaptor < Event > eventCaptor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( eventCaptor . capture ( ) ) ; Event event = eventCaptor . getValue ( ) ; assertThat ( event . getProperty ( RemoteConstants . EVENT_PROP_DATA_MESSAGE ) , is ( nullValue ( ) ) ) ; assertThat ( ( String ) event . getProperty ( RemoteConstants . EVENT_PROP_MESSAGE_TYPE ) , is ( AssetMessageType . DeleteResponse . toString ( ) ) ) ; }
Verify the remove asset response message sends an event with null data message.
Verify the remove asset response message sends an event with null data message .
// mock the channel the message came from // replay // verify the event contains the null data message