mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/asset/TestAssetMgrImpl.java
@Test
    public void testSyncPosition() throws InvalidProtocolBufferException
    {
        AssetModel assetModel = mock(AssetModel.class);
        when(assetModel.getName()).thenReturn("name1");
        when(assetModel.getUuid()).thenReturn(uuid1);
        
        m_SUT.syncPosition(0, assetModel);

        ArgumentCaptor<ExecuteCommandRequestData> messageCap = ArgumentCaptor.forClass(ExecuteCommandRequestData.class);
        verify(m_MessageFactory).createAssetMessage(eq(AssetMessageType.ExecuteCommandRequest), 
                messageCap.capture());
        verify(m_MessageWrapper).queue(eq(0), Mockito.any(AssetExecuteErrorHandler.class));
        
        //verify message
        ExecuteCommandRequestData data = ExecuteCommandRequestData.parseFrom(messageCap.getValue().toByteArray());
        assertThat(data.getUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(uuid1)));
        assertThat(data.getCommandType(), is(CommandTypesGen.CommandType.Enum.GET_POSITION_COMMAND));
    }
/**
     * Verify the asset mgr sync position sends the correct request.
     */
Verify the asset mgr sync position sends the correct request.
Verify the asset mgr sync position sends the correct request .
@Test
    public void testSyncPosition() throws InvalidProtocolBufferException
    {
        AssetModel assetModel = mock(AssetModel.class);
        when(assetModel.getName()).thenReturn("name1");
        when(assetModel.getUuid()).thenReturn(uuid1);
        m_SUT.syncPosition(0, assetModel);
        ArgumentCaptor<ExecuteCommandRequestData> messageCap = ArgumentCaptor.forClass(ExecuteCommandRequestData.class);
        verify(m_MessageFactory).createAssetMessage(eq(AssetMessageType.ExecuteCommandRequest), 
                messageCap.capture());
        verify(m_MessageWrapper).queue(eq(0), Mockito.any(AssetExecuteErrorHandler.class));
        ExecuteCommandRequestData data = ExecuteCommandRequestData.parseFrom(messageCap.getValue().toByteArray());
        assertThat(data.getUuid(), is(SharedMessageUtils.convertUUIDToProtoUUID(uuid1)));
        assertThat(data.getCommandType(), is(CommandTypesGen.CommandType.Enum.GET_POSITION_COMMAND));
    }
@ Test public void testSyncPosition ( ) throws InvalidProtocolBufferException { AssetModel assetModel = mock ( AssetModel . class ) ; when ( assetModel . getName ( ) ) . thenReturn ( "name1" ) ; when ( assetModel . getUuid ( ) ) . thenReturn ( uuid1 ) ; m_SUT . syncPosition ( 0 , assetModel ) ; ArgumentCaptor < ExecuteCommandRequestData > messageCap = ArgumentCaptor . forClass ( ExecuteCommandRequestData . class ) ; verify ( m_MessageFactory ) . createAssetMessage ( eq ( AssetMessageType . ExecuteCommandRequest ) , messageCap . capture ( ) ) ; verify ( m_MessageWrapper ) . queue ( eq ( 0 ) , Mockito . any ( AssetExecuteErrorHandler . class ) ) ; ExecuteCommandRequestData data = ExecuteCommandRequestData . parseFrom ( messageCap . getValue ( ) . toByteArray ( ) ) ; assertThat ( data . getUuid ( ) , is ( SharedMessageUtils . convertUUIDToProtoUUID ( uuid1 ) ) ) ; assertThat ( data . getCommandType ( ) , is ( CommandTypesGen . CommandType . Enum . GET_POSITION_COMMAND ) ) ; }
Verify the asset mgr sync position sends the correct request.
Verify the asset mgr sync position sends the correct request .
//verify message