edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/TestNovatelAsset.java
@Test
    public void testHandleStatusUpdateError() throws ValidationFailedException
    {
        final Observation obs = mock(Observation.class);
        final ComponentStatus compStatus = mock(ComponentStatus.class);
        final Status status = mock(Status.class);
        final OperatingStatus opStatus = mock(OperatingStatus.class);
        when(m_AssetContext.getLastStatus()).thenReturn(obs);
        when(m_NovatelStatusService.getStatus(Mockito.any(Observation.class), 
                Mockito.any(ComponentStatus.class))).thenReturn(status);
        when(status.getSummaryStatus()).thenReturn(opStatus);
        doThrow(ValidationFailedException.class).when(m_AssetContext).setStatus(status);
        
        m_SUT.handleStatusUpdate(compStatus);
        
        verify(m_AssetContext).setStatus(status);
        verify(m_AssetContext).setStatus(status.getSummaryStatus().getSummary(), 
                status.getSummaryStatus().getDescription());
    }
/**
     * Verify that the summary status is posted if an error occurs posting the complete status.
     */
Verify that the summary status is posted if an error occurs posting the complete status.
Verify that the summary status is posted if an error occurs posting the complete status .
@Test
    public void testHandleStatusUpdateError() throws ValidationFailedException
    {
        final Observation obs = mock(Observation.class);
        final ComponentStatus compStatus = mock(ComponentStatus.class);
        final Status status = mock(Status.class);
        final OperatingStatus opStatus = mock(OperatingStatus.class);
        when(m_AssetContext.getLastStatus()).thenReturn(obs);
        when(m_NovatelStatusService.getStatus(Mockito.any(Observation.class), 
                Mockito.any(ComponentStatus.class))).thenReturn(status);
        when(status.getSummaryStatus()).thenReturn(opStatus);
        doThrow(ValidationFailedException.class).when(m_AssetContext).setStatus(status);
        m_SUT.handleStatusUpdate(compStatus);
        verify(m_AssetContext).setStatus(status);
        verify(m_AssetContext).setStatus(status.getSummaryStatus().getSummary(), 
                status.getSummaryStatus().getDescription());
    }
@ Test public void testHandleStatusUpdateError ( ) throws ValidationFailedException { final Observation obs = mock ( Observation . class ) ; final ComponentStatus compStatus = mock ( ComponentStatus . class ) ; final Status status = mock ( Status . class ) ; final OperatingStatus opStatus = mock ( OperatingStatus . class ) ; when ( m_AssetContext . getLastStatus ( ) ) . thenReturn ( obs ) ; when ( m_NovatelStatusService . getStatus ( Mockito . any ( Observation . class ) , Mockito . any ( ComponentStatus . class ) ) ) . thenReturn ( status ) ; when ( status . getSummaryStatus ( ) ) . thenReturn ( opStatus ) ; doThrow ( ValidationFailedException . class ) . when ( m_AssetContext ) . setStatus ( status ) ; m_SUT . handleStatusUpdate ( compStatus ) ; verify ( m_AssetContext ) . setStatus ( status ) ; verify ( m_AssetContext ) . setStatus ( status . getSummaryStatus ( ) . getSummary ( ) , status . getSummaryStatus ( ) . getDescription ( ) ) ; }
Verify that the summary status is posted if an error occurs posting the complete status.
Verify that the summary status is posted if an error occurs posting the complete status .