mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testHandleExecuteCommandResponseNotGetPositionResponse()
    {
        Response baseResponse = Response.newBuilder().build();
        
        GetPanTiltResponseGen.GetPanTiltResponse panTiltResponse = 
                GetPanTiltResponseGen.GetPanTiltResponse.newBuilder().
                setBase(baseResponse).
                setPanTilt(OrientationOffset.newBuilder().
                        setAzimuth(AzimuthDegrees.newBuilder().setValue(10.0).build()).
                        setElevation(ElevationDegrees.newBuilder().setValue(10.0).build()).build()).
                build();
        
        ExecuteCommandResponseData response = ExecuteCommandResponseData.newBuilder().
                setResponse(panTiltResponse.toByteString()).
            setResponseType(CommandResponseEnumConverter.convertJavaEnumToProto(
                CommandResponseEnum.GET_PAN_TILT_RESPONSE)).
            setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid1)).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(m_EventAdmin, never()).postEvent(Mockito.any(Event.class));
    }
/**
     * Verify that another command response does not generate any events.
     */
Verify that another command response does not generate any events.
Verify that another command response does not generate any events .
@Test
    public void testHandleExecuteCommandResponseNotGetPositionResponse()
    {
        Response baseResponse = Response.newBuilder().build();
        GetPanTiltResponseGen.GetPanTiltResponse panTiltResponse = 
                GetPanTiltResponseGen.GetPanTiltResponse.newBuilder().
                setBase(baseResponse).
                setPanTilt(OrientationOffset.newBuilder().
                        setAzimuth(AzimuthDegrees.newBuilder().setValue(10.0).build()).
                        setElevation(ElevationDegrees.newBuilder().setValue(10.0).build()).build()).
                build();
        ExecuteCommandResponseData response = ExecuteCommandResponseData.newBuilder().
                setResponse(panTiltResponse.toByteString()).
            setResponseType(CommandResponseEnumConverter.convertJavaEnumToProto(
                CommandResponseEnum.GET_PAN_TILT_RESPONSE)).
            setUuid(SharedMessageUtils.convertUUIDToProtoUUID(uuid1)).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 testHandleExecuteCommandResponseNotGetPositionResponse ( ) { Response baseResponse = Response . newBuilder ( ) . build ( ) ; GetPanTiltResponseGen . GetPanTiltResponse panTiltResponse = GetPanTiltResponseGen . GetPanTiltResponse . newBuilder ( ) . setBase ( baseResponse ) . setPanTilt ( OrientationOffset . newBuilder ( ) . setAzimuth ( AzimuthDegrees . newBuilder ( ) . setValue ( 10.0 ) . build ( ) ) . setElevation ( ElevationDegrees . newBuilder ( ) . setValue ( 10.0 ) . build ( ) ) . build ( ) ) . build ( ) ; ExecuteCommandResponseData response = ExecuteCommandResponseData . newBuilder ( ) . setResponse ( panTiltResponse . toByteString ( ) ) . setResponseType ( CommandResponseEnumConverter . convertJavaEnumToProto ( CommandResponseEnum . GET_PAN_TILT_RESPONSE ) ) . setUuid ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid1 ) ) . 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 another command response does not generate any events.
Verify that another command response does not generate any events .
// properties for the event //the event