mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/asset/TestAssetImpl.java
@Test
    public void testExecuteSetPositionCommandNoPosOverride()
            throws CommandExecutionException, ValidationFailedException, InterruptedException, IOException
    {
        SetPositionCommand command = mock(SetPositionCommand.class);
        when(command.getLocation()).thenReturn(
                SpatialTypesFactory.newCoordinates(88d, 99d, 3d, SpatialTypesFactory.newEllipse(1d, 2d, 3d)));
        when(command.getOrientation()).thenReturn(SpatialTypesFactory.newOrientation(12d, 13d, 14d));
        m_SUT.executeCommand(command);

        verify(m_Proxy, never()).onExecuteCommand(command);
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();

        Map<String, Object> props = new HashMap<>();
        props.put(Asset.EVENT_PROP_ASSET_COMMAND_RESPONSE_TYPE, SetPositionResponse.class.getName());
        props.put(Asset.EVENT_PROP_ASSET_COMMAND_RESPONSE, notNullValue());
        EventAdminVerifier.assertLastEvent(m_EventAdmin, Asset.TOPIC_COMMAND_RESPONSE, props);

        Coordinates setCoords = getCoordsFromCommand(null);
        verifyCoordsWithEllipse(setCoords, 88d, 99d, 3d, 1d, 2d, 3d);

        Orientation setOrient = getOrientationFromCommand(null);
        verifyOrientation(setOrient, 12d, 13d, 14d);
    }
/**
     * Verify execute setposition command when not overridden works as intended.
     */
Verify execute setposition command when not overridden works as intended.
Verify execute setposition command when not overridden works as intended .
@Test
    public void testExecuteSetPositionCommandNoPosOverride()
            throws CommandExecutionException, ValidationFailedException, InterruptedException, IOException
    {
        SetPositionCommand command = mock(SetPositionCommand.class);
        when(command.getLocation()).thenReturn(
                SpatialTypesFactory.newCoordinates(88d, 99d, 3d, SpatialTypesFactory.newEllipse(1d, 2d, 3d)));
        when(command.getOrientation()).thenReturn(SpatialTypesFactory.newOrientation(12d, 13d, 14d));
        m_SUT.executeCommand(command);
        verify(m_Proxy, never()).onExecuteCommand(command);
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
        Map<String, Object> props = new HashMap<>();
        props.put(Asset.EVENT_PROP_ASSET_COMMAND_RESPONSE_TYPE, SetPositionResponse.class.getName());
        props.put(Asset.EVENT_PROP_ASSET_COMMAND_RESPONSE, notNullValue());
        EventAdminVerifier.assertLastEvent(m_EventAdmin, Asset.TOPIC_COMMAND_RESPONSE, props);
        Coordinates setCoords = getCoordsFromCommand(null);
        verifyCoordsWithEllipse(setCoords, 88d, 99d, 3d, 1d, 2d, 3d);
        Orientation setOrient = getOrientationFromCommand(null);
        verifyOrientation(setOrient, 12d, 13d, 14d);
    }
@ Test public void testExecuteSetPositionCommandNoPosOverride ( ) throws CommandExecutionException , ValidationFailedException , InterruptedException , IOException { SetPositionCommand command = mock ( SetPositionCommand . class ) ; when ( command . getLocation ( ) ) . thenReturn ( SpatialTypesFactory . newCoordinates ( 88d , 99d , 3d , SpatialTypesFactory . newEllipse ( 1d , 2d , 3d ) ) ) ; when ( command . getOrientation ( ) ) . thenReturn ( SpatialTypesFactory . newOrientation ( 12d , 13d , 14d ) ) ; m_SUT . executeCommand ( command ) ; verify ( m_Proxy , never ( ) ) . onExecuteCommand ( command ) ; verify ( m_WakeLock ) . activate ( ) ; verify ( m_WakeLock ) . cancel ( ) ; Map < String , Object > props = new HashMap < > ( ) ; props . put ( Asset . EVENT_PROP_ASSET_COMMAND_RESPONSE_TYPE , SetPositionResponse . class . getName ( ) ) ; props . put ( Asset . EVENT_PROP_ASSET_COMMAND_RESPONSE , notNullValue ( ) ) ; EventAdminVerifier . assertLastEvent ( m_EventAdmin , Asset . TOPIC_COMMAND_RESPONSE , props ) ; Coordinates setCoords = getCoordsFromCommand ( null ) ; verifyCoordsWithEllipse ( setCoords , 88d , 99d , 3d , 1d , 2d , 3d ) ; Orientation setOrient = getOrientationFromCommand ( null ) ; verifyOrientation ( setOrient , 12d , 13d , 14d ) ; }
Verify execute setposition command when not overridden works as intended.
Verify execute setposition command when not overridden works as intended .