/**
   * Test method for {@link
   * org.ihtsdo.otf.refset.service.upload.ImportRF2Service#importFile(java.io.InputStream,
   * java.lang.String)}.
   *
   * @throws EntityNotFoundException
   * @throws RefsetServiceException
   * @throws FileNotFoundException
   */
  @Test
  public void testImportFile()
      throws RefsetServiceException, EntityNotFoundException, FileNotFoundException {

    service.importFile(new FileInputStream(GOOD_FILE), "junit", "jnunit");
    verify(srp).process(anyListOf(Rf2Record.class), anyString(), anyString());
  }
  /** @throws java.lang.Exception */
  @Before
  public void setUp() throws Exception {

    service = new ImportRF2Service();

    srp = mock(SimpleRefsetProcessor.class);

    service.setSrp(srp);
    doNothing().when(srp).process(anyListOf(Rf2Record.class), anyString(), anyString());
  }
  /**
   * Test method for {@link
   * org.ihtsdo.otf.refset.service.upload.ImportRF2Service#importFile(java.io.InputStream,
   * java.lang.String)}.
   *
   * @throws EntityNotFoundException
   * @throws RefsetServiceException
   * @throws FileNotFoundException
   */
  @Test(expected = RefsetServiceException.class)
  public void testImportFileInvalidRequestInvalidFile()
      throws RefsetServiceException, EntityNotFoundException, FileNotFoundException {

    service.importFile(new FileInputStream(INVALID_FILE), "junit", "jnunit");
  }
  /**
   * Test method for {@link
   * org.ihtsdo.otf.refset.service.upload.ImportRF2Service#importFile(java.io.InputStream,
   * java.lang.String)}.
   *
   * @throws EntityNotFoundException
   * @throws RefsetServiceException
   * @throws FileNotFoundException
   */
  @Test(expected = IllegalArgumentException.class)
  public void testImportFileInvalidRequestNullOrEmptyRefsetId()
      throws RefsetServiceException, EntityNotFoundException, FileNotFoundException {

    service.importFile(new FileInputStream(GOOD_FILE), "", "jnunit");
  }
  /**
   * Test method for {@link
   * org.ihtsdo.otf.refset.service.upload.ImportRF2Service#importFile(java.io.InputStream,
   * java.lang.String)}.
   *
   * @throws EntityNotFoundException
   * @throws RefsetServiceException
   */
  @Test(expected = IllegalArgumentException.class)
  public void testImportFileInvalidRequest()
      throws RefsetServiceException, EntityNotFoundException {

    service.importFile(null, "jnunit", "jnunit");
  }