mil.dod.th.ose.linux.serial/test/mil/dod/th/ose/linux/physical/TestSerialPortInputStream.java
@Test
    public void testRead() throws IOException, FactoryException
    {
        when(FileOperations.readBuffer(eq(5), Mockito.any(byte[].class), eq(0), eq(1L), eq(0)))
            .thenAnswer(new Answer<Integer>()
            {
                @Override
                public Integer answer(InvocationOnMock invocation) throws Throwable
                {
                    byte[] buf = (byte[])invocation.getArguments()[1];
                    buf[0] = 0x6f;
                    return 1;
                }
            });
        
        assertThat(m_SUT.read(), is(0x6f));
    }
/**
     * Verify read returns the byte from {@link FileOperations}.
     */
Verify read returns the byte from  FileOperations.
Verify read returns the byte from FileOperations .
@Test
    public void testRead() throws IOException, FactoryException
    {
        when(FileOperations.readBuffer(eq(5), Mockito.any(byte[].class), eq(0), eq(1L), eq(0)))
            .thenAnswer(new Answer<Integer>()
            {
                @Override
                public Integer answer(InvocationOnMock invocation) throws Throwable
                {
                    byte[] buf = (byte[])invocation.getArguments()[1];
                    buf[0] = 0x6f;
                    return 1;
                }
            });
        assertThat(m_SUT.read(), is(0x6f));
    }
@ Test public void testRead ( ) throws IOException , FactoryException { when ( FileOperations . readBuffer ( eq ( 5 ) , Mockito . any ( byte [ ] . class ) , eq ( 0 ) , eq ( 1L ) , eq ( 0 ) ) ) . thenAnswer ( new Answer < Integer > ( ) { @ Override public Integer answer ( InvocationOnMock invocation ) throws Throwable { byte [ ] buf = ( byte [ ] ) invocation . getArguments ( ) [ 1 ] ; buf [ 0 ] = 0x6f ; return 1 ; } } ) ; assertThat ( m_SUT . read ( ) , is ( 0x6f ) ) ; }
Verify read returns the byte from {@link FileOperations}.
Verify read returns the byte from { @link FileOperations } .