edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/TestNovatelStatusService.java
@Test
    public void testGetStatusStatusHasChanged()
    {
        List<SummaryStatusEnum> statuses = Arrays.asList(SummaryStatusEnum.GOOD, SummaryStatusEnum.GOOD);
        List<ComponentStatus> lists = getMockComponentStatuses(m_ComponentTypes, m_Descriptors, statuses); 
        Status status = getLastStatus(lists);
        
        assertThat(status, notNullValue());
        assertThat(status.getSummaryStatus().getSummary(), is(SummaryStatusEnum.GOOD));
        assertThat(status.getSummaryStatus().getDescription(), is("Novatel asset is processing data as expected."));
       
        List<ComponentStatus> compStatuses = status.getComponentStatuses();
        verifyStatuses(compStatuses, lists);
        
        Observation observation = new Observation();
        observation.setStatus(status);
        
        statuses = Arrays.asList(SummaryStatusEnum.DEGRADED, SummaryStatusEnum.GOOD);
        
        lists = getMockComponentStatuses(m_ComponentTypes, m_Descriptors, statuses);
        
        Status newStatus = m_SUT.getStatus(observation, lists.get(0));
        assertThat(newStatus.getSummaryStatus().getSummary(), is(SummaryStatusEnum.DEGRADED));
        assertThat(newStatus.getSummaryStatus().getDescription(), 
                is("Not all supporting components are functioning as expected."));
        
        verifyStatuses(newStatus.getComponentStatuses(), lists);
    }
/**
     * Verify that if a status changes after the original has been made then a new status is made and returned.
     */
Verify that if a status changes after the original has been made then a new status is made and returned.
Verify that if a status changes after the original has been made then a new status is made and returned .
@Test
    public void testGetStatusStatusHasChanged()
    {
        List<SummaryStatusEnum> statuses = Arrays.asList(SummaryStatusEnum.GOOD, SummaryStatusEnum.GOOD);
        List<ComponentStatus> lists = getMockComponentStatuses(m_ComponentTypes, m_Descriptors, statuses); 
        Status status = getLastStatus(lists);
        assertThat(status, notNullValue());
        assertThat(status.getSummaryStatus().getSummary(), is(SummaryStatusEnum.GOOD));
        assertThat(status.getSummaryStatus().getDescription(), is("Novatel asset is processing data as expected."));
        List<ComponentStatus> compStatuses = status.getComponentStatuses();
        verifyStatuses(compStatuses, lists);
        Observation observation = new Observation();
        observation.setStatus(status);
        statuses = Arrays.asList(SummaryStatusEnum.DEGRADED, SummaryStatusEnum.GOOD);
        lists = getMockComponentStatuses(m_ComponentTypes, m_Descriptors, statuses);
        Status newStatus = m_SUT.getStatus(observation, lists.get(0));
        assertThat(newStatus.getSummaryStatus().getSummary(), is(SummaryStatusEnum.DEGRADED));
        assertThat(newStatus.getSummaryStatus().getDescription(), 
                is("Not all supporting components are functioning as expected."));
        verifyStatuses(newStatus.getComponentStatuses(), lists);
    }
@ Test public void testGetStatusStatusHasChanged ( ) { List < SummaryStatusEnum > statuses = Arrays . asList ( SummaryStatusEnum . GOOD , SummaryStatusEnum . GOOD ) ; List < ComponentStatus > lists = getMockComponentStatuses ( m_ComponentTypes , m_Descriptors , statuses ) ; Status status = getLastStatus ( lists ) ; assertThat ( status , notNullValue ( ) ) ; assertThat ( status . getSummaryStatus ( ) . getSummary ( ) , is ( SummaryStatusEnum . GOOD ) ) ; assertThat ( status . getSummaryStatus ( ) . getDescription ( ) , is ( "Novatel asset is processing data as expected." ) ) ; List < ComponentStatus > compStatuses = status . getComponentStatuses ( ) ; verifyStatuses ( compStatuses , lists ) ; Observation observation = new Observation ( ) ; observation . setStatus ( status ) ; statuses = Arrays . asList ( SummaryStatusEnum . DEGRADED , SummaryStatusEnum . GOOD ) ; lists = getMockComponentStatuses ( m_ComponentTypes , m_Descriptors , statuses ) ; Status newStatus = m_SUT . getStatus ( observation , lists . get ( 0 ) ) ; assertThat ( newStatus . getSummaryStatus ( ) . getSummary ( ) , is ( SummaryStatusEnum . DEGRADED ) ) ; assertThat ( newStatus . getSummaryStatus ( ) . getDescription ( ) , is ( "Not all supporting components are functioning as expected." ) ) ; verifyStatuses ( newStatus . getComponentStatuses ( ) , lists ) ; }
Verify that if a status changes after the original has been made then a new status is made and returned.
Verify that if a status changes after the original has been made then a new status is made and returned .