mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testHandleExecuteCommandResponseWithUnknownAssetModel()
    {
        //create all the orientation and coordinates measurements and put them in the response
        LongitudeWgsDegrees newLongitude = LongitudeWgsDegrees.newBuilder().
                setValue(10.0D).
                build();
        
        LatitudeWgsDegrees newLatitude = LatitudeWgsDegrees.newBuilder().
                setValue(10D).
                build();
        
        HaeMeters newHaeMeters = HaeMeters.newBuilder().
                setValue(10D).
                build();
        
        ElevationDegrees newElevation = ElevationDegrees.newBuilder().
                setValue(10D).
                build();
        
        HeadingDegrees newHeading = HeadingDegrees.newBuilder().
                setValue(10D).
                build();
        
        Orientation orien = Orientation.newBuilder().
                setElevation(newElevation).
                setHeading(newHeading).
                build();
        
        Coordinates local = Coordinates.newBuilder().
                setLongitude(newLongitude).
                setAltitude(newHaeMeters).
                setLatitude(newLatitude).
                build();
        
        //Build the base response message required by all response messages.
        Response baseResponse = Response.newBuilder().build();
        
        GetPositionResponseGen.GetPositionResponse getPositionResponse = GetPositionResponseGen.
                GetPositionResponse.newBuilder().
                setBase(baseResponse).
                setOrientation(orien).
                setLocation(local).
                build();
                
        ExecuteCommandResponseData response = ExecuteCommandResponseData.newBuilder().
                setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid1)).
                setResponse(getPositionResponse.toByteString()).
                setResponseType(CommandResponseEnumConverter.convertJavaEnumToProto(
                    CommandResponseEnum.GET_POSITION_RESPONSE)).
                build();
        
        // properties for the event
        final Map<String, Object> props = new HashMap<String, Object>();
        props.put(RemoteConstants.EVENT_PROP_DATA_MESSAGE, response);
        props.put(RemoteConstants.EVENT_PROP_SOURCE_ID, 1);
        props.put(RemoteConstants.EVENT_PROP_DEST_ID, 0);
        props.put(RemoteConstants.EVENT_PROP_NAMESPACE, Namespace.Asset.toString());
        props.put(RemoteConstants.EVENT_PROP_MESSAGE_TYPE, 
            AssetMessageType.ExecuteCommandResponse.toString());
        
        //the event
        Event event = new Event(RemoteConstants.TOPIC_MESSAGE_RECEIVED, props);
        
        m_AssetHelper.handleEvent(event);
        
        //verify EventAdmin posted that the location was updated
        verify(m_EventAdmin, never()).postEvent(Mockito.any(Event.class));
    }
/**
     * Verify that a get position response from an unknown asset model does not produce
     * any events.
     */
Verify that a get position response from an unknown asset model does not produce
any events.
Verify that a get position response from an unknown asset model does not produce any events .
@Test
    public void testHandleExecuteCommandResponseWithUnknownAssetModel()
    {
        LongitudeWgsDegrees newLongitude = LongitudeWgsDegrees.newBuilder().
                setValue(10.0D).
                build();
        LatitudeWgsDegrees newLatitude = LatitudeWgsDegrees.newBuilder().
                setValue(10D).
                build();
        HaeMeters newHaeMeters = HaeMeters.newBuilder().
                setValue(10D).
                build();
        ElevationDegrees newElevation = ElevationDegrees.newBuilder().
                setValue(10D).
                build();
        HeadingDegrees newHeading = HeadingDegrees.newBuilder().
                setValue(10D).
                build();
        Orientation orien = Orientation.newBuilder().
                setElevation(newElevation).
                setHeading(newHeading).
                build();
        Coordinates local = Coordinates.newBuilder().
                setLongitude(newLongitude).
                setAltitude(newHaeMeters).
                setLatitude(newLatitude).
                build();
        Response baseResponse = Response.newBuilder().build();
        GetPositionResponseGen.GetPositionResponse getPositionResponse = GetPositionResponseGen.
                GetPositionResponse.newBuilder().
                setBase(baseResponse).
                setOrientation(orien).
                setLocation(local).
                build();
        ExecuteCommandResponseData response = ExecuteCommandResponseData.newBuilder().
                setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid1)).
                setResponse(getPositionResponse.toByteString()).
                setResponseType(CommandResponseEnumConverter.convertJavaEnumToProto(
                    CommandResponseEnum.GET_POSITION_RESPONSE)).
                build();
        final Map<String, Object> props = new HashMap<String, Object>();
        props.put(RemoteConstants.EVENT_PROP_DATA_MESSAGE, response);
        props.put(RemoteConstants.EVENT_PROP_SOURCE_ID, 1);
        props.put(RemoteConstants.EVENT_PROP_DEST_ID, 0);
        props.put(RemoteConstants.EVENT_PROP_NAMESPACE, Namespace.Asset.toString());
        props.put(RemoteConstants.EVENT_PROP_MESSAGE_TYPE, 
            AssetMessageType.ExecuteCommandResponse.toString());
        Event event = new Event(RemoteConstants.TOPIC_MESSAGE_RECEIVED, props);
        m_AssetHelper.handleEvent(event);
        verify(m_EventAdmin, never()).postEvent(Mockito.any(Event.class));
    }
@ Test public void testHandleExecuteCommandResponseWithUnknownAssetModel ( ) { LongitudeWgsDegrees newLongitude = LongitudeWgsDegrees . newBuilder ( ) . setValue ( 10.0D ) . build ( ) ; LatitudeWgsDegrees newLatitude = LatitudeWgsDegrees . newBuilder ( ) . setValue ( 10D ) . build ( ) ; HaeMeters newHaeMeters = HaeMeters . newBuilder ( ) . setValue ( 10D ) . build ( ) ; ElevationDegrees newElevation = ElevationDegrees . newBuilder ( ) . setValue ( 10D ) . build ( ) ; HeadingDegrees newHeading = HeadingDegrees . newBuilder ( ) . setValue ( 10D ) . build ( ) ; Orientation orien = Orientation . newBuilder ( ) . setElevation ( newElevation ) . setHeading ( newHeading ) . build ( ) ; Coordinates local = Coordinates . newBuilder ( ) . setLongitude ( newLongitude ) . setAltitude ( newHaeMeters ) . setLatitude ( newLatitude ) . build ( ) ; Response baseResponse = Response . newBuilder ( ) . build ( ) ; GetPositionResponseGen . GetPositionResponse getPositionResponse = GetPositionResponseGen . GetPositionResponse . newBuilder ( ) . setBase ( baseResponse ) . setOrientation ( orien ) . setLocation ( local ) . build ( ) ; ExecuteCommandResponseData response = ExecuteCommandResponseData . newBuilder ( ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid1 ) ) . setResponse ( getPositionResponse . toByteString ( ) ) . setResponseType ( CommandResponseEnumConverter . convertJavaEnumToProto ( CommandResponseEnum . GET_POSITION_RESPONSE ) ) . build ( ) ; final Map < String , Object > props = new HashMap < String , Object > ( ) ; props . put ( RemoteConstants . EVENT_PROP_DATA_MESSAGE , response ) ; props . put ( RemoteConstants . EVENT_PROP_SOURCE_ID , 1 ) ; props . put ( RemoteConstants . EVENT_PROP_DEST_ID , 0 ) ; props . put ( RemoteConstants . EVENT_PROP_NAMESPACE , Namespace . Asset . toString ( ) ) ; props . put ( RemoteConstants . EVENT_PROP_MESSAGE_TYPE , AssetMessageType . ExecuteCommandResponse . toString ( ) ) ; Event event = new Event ( RemoteConstants . TOPIC_MESSAGE_RECEIVED , props ) ; m_AssetHelper . handleEvent ( event ) ; verify ( m_EventAdmin , never ( ) ) . postEvent ( Mockito . any ( Event . class ) ) ; }
Verify that a get position response from an unknown asset model does not produce
 any events.
Verify that a get position response from an unknown asset model does not produce any events .
//create all the orientation and coordinates measurements and put them in the response //Build the base response message required by all response messages. // properties for the event //the event //verify EventAdmin posted that the location was updated