edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/impl/timechanger/TestTimeChangeImpl.java
@Test
    public void testConnectTimeService() throws IOException, InterruptedException
    {
        m_SUT.connectTimeService(m_StatusHandler, PORT);
        
        ArgumentCaptor<ComponentStatus> statusCaptor = ArgumentCaptor.forClass(ComponentStatus.class);
        verify(m_StatusHandler, timeout(1000).atLeast(1)).handleStatusUpdate(statusCaptor.capture());
        
        m_SUT.disconnectTimeService();
        
        verify(m_ClientSocketFactory, atLeast(1)).createClientSocket(Mockito.anyString(), Mockito.anyInt());
        
        assertThat(statusCaptor.getValue(), notNullValue());
        
        ComponentStatus status = statusCaptor.getValue();
        assertThat(status.getComponent().getType(), is(ComponentTypeEnum.SOFTWARE_UNIT));
        assertThat(status.getComponent().getDescription(), is("Time Service"));
        assertThat(status.getStatus().getSummary(), is(SummaryStatusEnum.GOOD));
    }
/**
     * Verify connection can be set up.
     */
Verify connection can be set up.
Verify connection can be set up .
@Test
    public void testConnectTimeService() throws IOException, InterruptedException
    {
        m_SUT.connectTimeService(m_StatusHandler, PORT);
        ArgumentCaptor<ComponentStatus> statusCaptor = ArgumentCaptor.forClass(ComponentStatus.class);
        verify(m_StatusHandler, timeout(1000).atLeast(1)).handleStatusUpdate(statusCaptor.capture());
        m_SUT.disconnectTimeService();
        verify(m_ClientSocketFactory, atLeast(1)).createClientSocket(Mockito.anyString(), Mockito.anyInt());
        assertThat(statusCaptor.getValue(), notNullValue());
        ComponentStatus status = statusCaptor.getValue();
        assertThat(status.getComponent().getType(), is(ComponentTypeEnum.SOFTWARE_UNIT));
        assertThat(status.getComponent().getDescription(), is("Time Service"));
        assertThat(status.getStatus().getSummary(), is(SummaryStatusEnum.GOOD));
    }
@ Test public void testConnectTimeService ( ) throws IOException , InterruptedException { m_SUT . connectTimeService ( m_StatusHandler , PORT ) ; ArgumentCaptor < ComponentStatus > statusCaptor = ArgumentCaptor . forClass ( ComponentStatus . class ) ; verify ( m_StatusHandler , timeout ( 1000 ) . atLeast ( 1 ) ) . handleStatusUpdate ( statusCaptor . capture ( ) ) ; m_SUT . disconnectTimeService ( ) ; verify ( m_ClientSocketFactory , atLeast ( 1 ) ) . createClientSocket ( Mockito . anyString ( ) , Mockito . anyInt ( ) ) ; assertThat ( statusCaptor . getValue ( ) , notNullValue ( ) ) ; ComponentStatus status = statusCaptor . getValue ( ) ; assertThat ( status . getComponent ( ) . getType ( ) , is ( ComponentTypeEnum . SOFTWARE_UNIT ) ) ; assertThat ( status . getComponent ( ) . getDescription ( ) , is ( "Time Service" ) ) ; assertThat ( status . getStatus ( ) . getSummary ( ) , is ( SummaryStatusEnum . GOOD ) ) ; }
Verify connection can be set up.
Verify connection can be set up .