/**
   * Tests <code>{@link CopilotProjectDAOImpl#retrieve(long)}</code> method.
   *
   * @throws CopilotDAOException if any error occurs
   */
  @Test
  public void testRetrieve1() throws CopilotDAOException {

    CopilotProfile copilotProfile1 = TestHelper.createCopilotProfile();
    CopilotProject copilotProject1 = TestHelper.createCopilotProject();

    TestHelper.persistCopilotProjectDependencies(
        hibernateTemplate, copilotProfile1, copilotProject1);
    hibernateTemplate.save(copilotProject1);

    CopilotProfile copilotProfile2 = TestHelper.createCopilotProfile();
    CopilotProject copilotProject2 = TestHelper.createCopilotProject();

    TestHelper.persistCopilotProjectDependencies(
        hibernateTemplate, copilotProfile2, copilotProject2);
    hibernateTemplate.save(copilotProject2);

    CopilotProject result = instance.retrieve(copilotProject1.getId());

    assertCopilotProject(copilotProject1, result);

    result = instance.retrieve(copilotProject2.getId());

    assertCopilotProject(copilotProject2, result);
  }
  /**
   * Tests <code>{@link CopilotProjectDAOImpl#retrieve(long)}</code> method.
   *
   * <p>{@link CopilotDAOException} is expected.
   *
   * @throws CopilotDAOException if any error occurs
   */
  @Test(expected = CopilotDAOException.class)
  public void testRetrieveFailure2() throws CopilotDAOException {

    ApplicationContext applicationContext =
        new ClassPathXmlApplicationContext("invalidApplicationContext.xml");
    CopilotProjectDAOImpl copilotProjectDAO = new CopilotProjectDAOImpl();
    copilotProjectDAO.setSessionFactory(
        (SessionFactory) applicationContext.getBean("sessionFactory"));

    copilotProjectDAO.retrieve(1L);
  }
  /**
   * Tests <code>{@link CopilotProjectDAOImpl#retrieve(long)}</code> method when entity id is 0.
   *
   * <p>{@link IllegalArgumentException} is expected.
   *
   * @throws CopilotDAOException if any error occurs
   */
  @Test(expected = IllegalArgumentException.class)
  public void testRetrieveZero() throws CopilotDAOException {

    instance.retrieve(0L);
  }
  /**
   * Tests <code>{@link CopilotProjectDAOImpl#retrieve(long)}</code> method.
   *
   * @throws CopilotDAOException if any error occurs
   */
  @Test
  public void testRetrieve2() throws CopilotDAOException {

    Assert.assertNull("Null was expected.", instance.retrieve(1L));
  }