mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/datastream/TestDataStreamMessageService.java
@Test
    public final void testIllegalArgumentException() throws IOException
    {
        GetCapabilitiesRequestData request = GetCapabilitiesRequestData.newBuilder().
                setProductType("bad.factory").build();
        DataStreamServiceNamespace dataStreamMessage = DataStreamServiceNamespace.newBuilder().
                setType(DataStreamServiceMessageType.GetCapabilitiesRequest).
                setData(request.toByteString()).build();
        
        TerraHarvestPayload payload = createPayload(dataStreamMessage);
        TerraHarvestMessage message = createMessage(dataStreamMessage);
        
        RemoteChannel channel =  mock(RemoteChannel.class);
        
        m_SUT.handleMessage(message, payload, channel);
        
        verify(m_MessageFactory).createBaseErrorMessage(message, ErrorCode.INVALID_VALUE,
                "Cannot complete request. Factory not found.");
        
        verify(m_ResponseWrapper).queue(channel);
    }
/**
     * Test and verify that illegal argument exception is handled properly and that the error message is queued.
     */
Test and verify that illegal argument exception is handled properly and that the error message is queued.
Test and verify that illegal argument exception is handled properly and that the error message is queued .
@Test
    public final void testIllegalArgumentException() throws IOException
    {
        GetCapabilitiesRequestData request = GetCapabilitiesRequestData.newBuilder().
                setProductType("bad.factory").build();
        DataStreamServiceNamespace dataStreamMessage = DataStreamServiceNamespace.newBuilder().
                setType(DataStreamServiceMessageType.GetCapabilitiesRequest).
                setData(request.toByteString()).build();
        TerraHarvestPayload payload = createPayload(dataStreamMessage);
        TerraHarvestMessage message = createMessage(dataStreamMessage);
        RemoteChannel channel =  mock(RemoteChannel.class);
        m_SUT.handleMessage(message, payload, channel);
        verify(m_MessageFactory).createBaseErrorMessage(message, ErrorCode.INVALID_VALUE,
                "Cannot complete request. Factory not found.");
        verify(m_ResponseWrapper).queue(channel);
    }
@ Test public final void testIllegalArgumentException ( ) throws IOException { GetCapabilitiesRequestData request = GetCapabilitiesRequestData . newBuilder ( ) . setProductType ( "bad.factory" ) . build ( ) ; DataStreamServiceNamespace dataStreamMessage = DataStreamServiceNamespace . newBuilder ( ) . setType ( DataStreamServiceMessageType . GetCapabilitiesRequest ) . setData ( request . toByteString ( ) ) . build ( ) ; TerraHarvestPayload payload = createPayload ( dataStreamMessage ) ; TerraHarvestMessage message = createMessage ( dataStreamMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; m_SUT . handleMessage ( message , payload , channel ) ; verify ( m_MessageFactory ) . createBaseErrorMessage ( message , ErrorCode . INVALID_VALUE , "Cannot complete request. Factory not found." ) ; verify ( m_ResponseWrapper ) . queue ( channel ) ; }
Test and verify that illegal argument exception is handled properly and that the error message is queued.
Test and verify that illegal argument exception is handled properly and that the error message is queued .