edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/TestNovatelAsset.java
@Test
    public void testHandleInsPvaMessageUnknown() throws AssetException, IOException, 
        IllegalArgumentException, PersistenceFailedException, NovatelMessageException, ValidationFailedException
    {
        //update props so that the message is immediately handled
        Map<String, Object> configProps = createConfigProps();
        configProps.put(NovatelAssetAttributes.CONFIG_PROP_HANDLE_MESSAGE_FREQUENCY, 1);
        m_SUT.updated(configProps);
        
        //mock message
        when(m_Parser.parseInsMessage(anyString())).
            thenThrow(new NovatelMessageException("blarg", FormatProblem.OTHER));
        
        m_SUT.handleDataString(NovatelConstants.NOVATEL_INSPVA_MESSAGE + "alsdkjfksljdf");
        
        ArgumentCaptor<ComponentStatus> statusCap = ArgumentCaptor.forClass(ComponentStatus.class);
        
        //verify one event for bad status
        verify(m_NovatelStatusService, times(3)).getStatus(Mockito.any(Observation.class), statusCap.capture());
        
        //get the message readers component status
        ComponentStatus capStatus = statusCap.getValue();
        assertThat(capStatus.getStatus().getSummary(), is(SummaryStatusEnum.UNKNOWN));
    }
/**
     * Verify that the asset can handle an exception with "other" type.
     * Verify unknown status.
     */
Verify that the asset can handle an exception with "other" type.
Verify unknown status.
Verify that the asset can handle an exception with " other " type . Verify unknown status .
@Test
    public void testHandleInsPvaMessageUnknown() throws AssetException, IOException, 
        IllegalArgumentException, PersistenceFailedException, NovatelMessageException, ValidationFailedException
    {
        Map<String, Object> configProps = createConfigProps();
        configProps.put(NovatelAssetAttributes.CONFIG_PROP_HANDLE_MESSAGE_FREQUENCY, 1);
        m_SUT.updated(configProps);
        when(m_Parser.parseInsMessage(anyString())).
            thenThrow(new NovatelMessageException("blarg", FormatProblem.OTHER));
        m_SUT.handleDataString(NovatelConstants.NOVATEL_INSPVA_MESSAGE + "alsdkjfksljdf");
        ArgumentCaptor<ComponentStatus> statusCap = ArgumentCaptor.forClass(ComponentStatus.class);
        verify(m_NovatelStatusService, times(3)).getStatus(Mockito.any(Observation.class), statusCap.capture());
        ComponentStatus capStatus = statusCap.getValue();
        assertThat(capStatus.getStatus().getSummary(), is(SummaryStatusEnum.UNKNOWN));
    }
@ Test public void testHandleInsPvaMessageUnknown ( ) throws AssetException , IOException , IllegalArgumentException , PersistenceFailedException , NovatelMessageException , ValidationFailedException { Map < String , Object > configProps = createConfigProps ( ) ; configProps . put ( NovatelAssetAttributes . CONFIG_PROP_HANDLE_MESSAGE_FREQUENCY , 1 ) ; m_SUT . updated ( configProps ) ; when ( m_Parser . parseInsMessage ( anyString ( ) ) ) . thenThrow ( new NovatelMessageException ( "blarg" , FormatProblem . OTHER ) ) ; m_SUT . handleDataString ( NovatelConstants . NOVATEL_INSPVA_MESSAGE + "alsdkjfksljdf" ) ; ArgumentCaptor < ComponentStatus > statusCap = ArgumentCaptor . forClass ( ComponentStatus . class ) ; verify ( m_NovatelStatusService , times ( 3 ) ) . getStatus ( Mockito . any ( Observation . class ) , statusCap . capture ( ) ) ; ComponentStatus capStatus = statusCap . getValue ( ) ; assertThat ( capStatus . getStatus ( ) . getSummary ( ) , is ( SummaryStatusEnum . UNKNOWN ) ) ; }
Verify that the asset can handle an exception with "other" type.
Verify that the asset can handle an exception with " other " type .
//update props so that the message is immediately handled //mock message //verify one event for bad status //get the message readers component status