mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/observation/TestObservationMessageService.java
@Test
    public final void testFindByUUID_InvalidFormat() throws Exception
    {
        //build request
        FindObservationByUUIDRequestData request = FindObservationByUUIDRequestData.newBuilder()
                .setObservationFormat(RemoteTypesGen.LexiconFormat.Enum.XML).build();
        ObservationStoreNamespace obsMessage = ObservationStoreNamespace.newBuilder().
            setData(request.toByteString()).
            setType(ObservationStoreMessageType.FindObservationByUUIDRequest).build();
        TerraHarvestPayload payload = createPayload(obsMessage);
        TerraHarvestMessage thMessage = createMessageObservationStore(obsMessage);

        // mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);
        // replay
        try
        {
            m_SUT.handleMessage(thMessage, payload, channel);
            fail("Expecting exception as requested format is not supported");
        }
        catch (UnsupportedOperationException e)
        {
            
        }
    }
/**
     * Verify exception is thrown if requested format is invalid.
     */
Verify exception is thrown if requested format is invalid.
Verify exception is thrown if requested format is invalid .
@Test
    public final void testFindByUUID_InvalidFormat() throws Exception
    {
        FindObservationByUUIDRequestData request = FindObservationByUUIDRequestData.newBuilder()
                .setObservationFormat(RemoteTypesGen.LexiconFormat.Enum.XML).build();
        ObservationStoreNamespace obsMessage = ObservationStoreNamespace.newBuilder().
            setData(request.toByteString()).
            setType(ObservationStoreMessageType.FindObservationByUUIDRequest).build();
        TerraHarvestPayload payload = createPayload(obsMessage);
        TerraHarvestMessage thMessage = createMessageObservationStore(obsMessage);
        RemoteChannel channel = mock(RemoteChannel.class);
        try
        {
            m_SUT.handleMessage(thMessage, payload, channel);
            fail("Expecting exception as requested format is not supported");
        }
        catch (UnsupportedOperationException e)
        {
        }
    }
@ Test public final void testFindByUUID_InvalidFormat ( ) throws Exception { FindObservationByUUIDRequestData request = FindObservationByUUIDRequestData . newBuilder ( ) . setObservationFormat ( RemoteTypesGen . LexiconFormat . Enum . XML ) . build ( ) ; ObservationStoreNamespace obsMessage = ObservationStoreNamespace . newBuilder ( ) . setData ( request . toByteString ( ) ) . setType ( ObservationStoreMessageType . FindObservationByUUIDRequest ) . build ( ) ; TerraHarvestPayload payload = createPayload ( obsMessage ) ; TerraHarvestMessage thMessage = createMessageObservationStore ( obsMessage ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; try { m_SUT . handleMessage ( thMessage , payload , channel ) ; fail ( "Expecting exception as requested format is not supported" ) ; } catch ( UnsupportedOperationException e ) { } }
Verify exception is thrown if requested format is invalid.
Verify exception is thrown if requested format is invalid .
//build request // mock the channel the message came from // replay