mil.dod.th.ose.controller/test/mil/dod/th/ose/controller/impl/TestTerraHarvestControllerImpl.java
@Test
    public void testFileNotFound() throws Exception
    {
        // should be once from setUp method before file service was mocked to return false
        verify(m_FileService, times(1)).createFileInputStream(Mockito.any(File.class));
        
        when(m_FileService.doesFileExist(Mockito.any(File.class))).thenReturn(false);
        
        // call activate again with file service mocked to say file does NOT exist
        m_SUT.activate(m_Context);
        
        // make sure still holding at 1 from before
        verify(m_FileService, times(1)).createFileInputStream(Mockito.any(File.class));
    }
/**
     * Verify the file input stream is not created if file is not found. 
     */
Verify the file input stream is not created if file is not found.
Verify the file input stream is not created if file is not found .
@Test
    public void testFileNotFound() throws Exception
    {
        verify(m_FileService, times(1)).createFileInputStream(Mockito.any(File.class));
        when(m_FileService.doesFileExist(Mockito.any(File.class))).thenReturn(false);
        m_SUT.activate(m_Context);
        verify(m_FileService, times(1)).createFileInputStream(Mockito.any(File.class));
    }
@ Test public void testFileNotFound ( ) throws Exception { verify ( m_FileService , times ( 1 ) ) . createFileInputStream ( Mockito . any ( File . class ) ) ; when ( m_FileService . doesFileExist ( Mockito . any ( File . class ) ) ) . thenReturn ( false ) ; m_SUT . activate ( m_Context ) ; verify ( m_FileService , times ( 1 ) ) . createFileInputStream ( Mockito . any ( File . class ) ) ; }
Verify the file input stream is not created if file is not found.
Verify the file input stream is not created if file is not found .
// should be once from setUp method before file service was mocked to return false // call activate again with file service mocked to say file does NOT exist // make sure still holding at 1 from before