mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/asset/TestAssetDirectoryMessageService.java
@Test
    public final void testIllegalArgumentException() throws IOException
    {
        //build request
        GetCapabilitiesRequestData request6 = GetCapabilitiesRequestData.newBuilder().
                setProductType("bad.factory").build();
        AssetDirectoryServiceNamespace assetMessage = AssetDirectoryServiceNamespace.newBuilder().
                setType(AssetDirectoryServiceMessageType.GetCapabilitiesRequest).
                setData(request6.toByteString()).build();
        TerraHarvestPayload payload = createPayload(assetMessage);
        TerraHarvestMessage message = createMessage(assetMessage);
        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.");
        //reused channel
        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 request6 = GetCapabilitiesRequestData.newBuilder().
                setProductType("bad.factory").build();
        AssetDirectoryServiceNamespace assetMessage = AssetDirectoryServiceNamespace.newBuilder().
                setType(AssetDirectoryServiceMessageType.GetCapabilitiesRequest).
                setData(request6.toByteString()).build();
        TerraHarvestPayload payload = createPayload(assetMessage);
        TerraHarvestMessage message = createMessage(assetMessage);
        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 request6 = GetCapabilitiesRequestData . newBuilder ( ) . setProductType ( "bad.factory" ) . build ( ) ; AssetDirectoryServiceNamespace assetMessage = AssetDirectoryServiceNamespace . newBuilder ( ) . setType ( AssetDirectoryServiceMessageType . GetCapabilitiesRequest ) . setData ( request6 . toByteString ( ) ) . build ( ) ; TerraHarvestPayload payload = createPayload ( assetMessage ) ; TerraHarvestMessage message = createMessage ( assetMessage ) ; 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 .
//build request //reused channel