edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/TestNovatelAsset.java
@Test
    public void testOnActivateOffsetKnown() throws AssetException, IOException
    {
        when(m_Parser.isOffsetKnown()).thenReturn(true);
        
        //activate the asset
        m_SUT.onActivate();
        
        //verify dep interaction
        verify(m_ConnectionManager).startProcessing(DEFAULT_NOVATEL_PHYS_PORT, DEFAULT_NOVATEL_BAUD_RATE);
        verify(m_MessageReader).startRetreiving(m_SUT);
        verify(m_TimeChangeService).connectTimeService(eq(m_SUT), eq(4444));
        
        //capture the status
        ArgumentCaptor<ComponentStatus> statusCap = ArgumentCaptor.forClass(ComponentStatus.class);
        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.GOOD));
        
    }
/**
     * Verify that the asset can be activated.
     * Verify GOOD status, as the offset will be mocked to be known
     */
Verify that the asset can be activated.
Verify GOOD status, as the offset will be mocked to be known
Verify that the asset can be activated . Verify GOOD status as the offset will be mocked to be known
@Test
    public void testOnActivateOffsetKnown() throws AssetException, IOException
    {
        when(m_Parser.isOffsetKnown()).thenReturn(true);
        m_SUT.onActivate();
        verify(m_ConnectionManager).startProcessing(DEFAULT_NOVATEL_PHYS_PORT, DEFAULT_NOVATEL_BAUD_RATE);
        verify(m_MessageReader).startRetreiving(m_SUT);
        verify(m_TimeChangeService).connectTimeService(eq(m_SUT), eq(4444));
        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.GOOD));
    }
@ Test public void testOnActivateOffsetKnown ( ) throws AssetException , IOException { when ( m_Parser . isOffsetKnown ( ) ) . thenReturn ( true ) ; m_SUT . onActivate ( ) ; verify ( m_ConnectionManager ) . startProcessing ( DEFAULT_NOVATEL_PHYS_PORT , DEFAULT_NOVATEL_BAUD_RATE ) ; verify ( m_MessageReader ) . startRetreiving ( m_SUT ) ; verify ( m_TimeChangeService ) . connectTimeService ( eq ( m_SUT ) , eq ( 4444 ) ) ; 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 . GOOD ) ) ; }
Verify that the asset can be activated.
Verify that the asset can be activated .
//activate the asset //verify dep interaction //capture the status //get the message readers component status