/**
   * Tests <code>{@link CopilotProjectDAOImpl#getCopilotProjects(long)}</code> method.
   *
   * @throws CopilotDAOException if any error occurs
   */
  @Test
  public void testGetCopilotProjects1() 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);

    List<CopilotProject> result =
        instance.getCopilotProjects(copilotProject1.getCopilotProfileId());

    Assert.assertEquals("Only one result was expected.", 1, result.size());
    assertCopilotProject(copilotProject1, result.get(0));

    result = instance.getCopilotProjects(copilotProject2.getCopilotProfileId());

    Assert.assertEquals("Only one result was expected.", 1, result.size());
    assertCopilotProject(copilotProject2, result.get(0));
  }
  /**
   * Tests <code>{@link CopilotProjectDAOImpl#getCopilotProjects(long)}</code> method.
   *
   * @throws CopilotDAOException if any error occurs
   */
  @Test
  public void testGetCopilotProjects2() throws CopilotDAOException {

    CopilotProfile copilotProfile = TestHelper.createCopilotProfile();
    CopilotProject copilotProject1 = TestHelper.createCopilotProject();
    CopilotProject copilotProject2 = TestHelper.createCopilotProject();

    hibernateTemplate.save(copilotProfile.getStatus());
    hibernateTemplate.save(copilotProfile);

    copilotProject1.setCopilotProfileId(copilotProfile.getId());
    hibernateTemplate.save(copilotProject1.getStatus());
    hibernateTemplate.save(copilotProject1.getCopilotType());
    hibernateTemplate.save(copilotProject1);

    copilotProject2.setCopilotProfileId(copilotProfile.getId());
    hibernateTemplate.save(copilotProject2.getStatus());
    hibernateTemplate.save(copilotProject2.getCopilotType());
    hibernateTemplate.save(copilotProject2);

    List<CopilotProject> result =
        instance.getCopilotProjects(copilotProject1.getCopilotProfileId());

    Assert.assertEquals("Two results were expected.", 2, result.size());
    assertCopilotProject(copilotProject1, result.get(0));
    assertCopilotProject(copilotProject2, result.get(1));
  }