@Test
  public void testCreateAndUpdateTranslation() throws Exception {
    int initialSize = translationService.findAllTranslations().size();
    TaskTranslation translation2 =
        new TaskTranslation(
            100l,
            "1000",
            "63636",
            null,
            null,
            null,
            null,
            100l,
            "Je m'appelle Jacques",
            TaskTranslation.STATUS_NEW);
    translationService.createTranslation(translation2);
    assertNotNull(translation2.getAuthor());
    assertNotNull(translation2.getUrl());

    TaskTranslation translation = new TaskTranslation();
    translationService.createTranslation(translation);
    assertNotNull(translation.getTranslationId());
    String newVal = "TEST";
    translation.setStatus(newVal);
    translationService.updateTranslation(translation);
    translation = translationService.findById(translation.getTranslationId());
    // we would really need to flush and clear the hibernate session for this next validation
    assertEquals(newVal, translation.getStatus());
    translationService.delete(translation);
    assertEquals(initialSize, translationService.findAllTranslations().size());
  }
  @Test
  public void testPushAllTranslations() {

    ClientApp clientApp =
        clientAppService.getAllClientAppByClientID(new Long(TEST_CLIENT_ID)).get(0);
    Long tcProjectId = new Long(TEST_TWB_PROJECT_ID);
    /*        if (clientApp.getTcProjectId() != null) {
                tcProjectId = clientApp.getTcProjectId();
            }
    */
    List translations = generateTestTranslationTasks(NEW_CLIENT_APP_ID, true, 6);
    Long clientAppId = new Long(NEW_CLIENT_APP_ID);
    List checkTranslations =
        translationService.findAllTranslationsByClientAppIdAndStatus(
            clientAppId, TaskTranslation.STATUS_NEW, 100);

    assert (checkTranslations.size() > 0);

    Map result =
        translationService.pushAllTranslations(clientAppId, new Long(TEST_TWB_PROJECT_ID), 0, 5);
    assertNotNull(result);

    List<TaskTranslation> inProgressTranslations =
        translationService.findAllTranslationsByClientAppIdAndStatus(
            clientAppId, TaskTranslation.STATUS_IN_PROGRESS, 100);
    assert (inProgressTranslations.size() > (checkTranslations.size() - 5));
    Iterator<TaskTranslation> itr = inProgressTranslations.iterator();
    while (itr.hasNext()) {
      TaskTranslation translation = itr.next();
      assert (translation.getStatus().equals(TaskTranslation.STATUS_IN_PROGRESS));
    }

    Iterator<TaskTranslation> itr2 = checkTranslations.iterator();
    while (itr2.hasNext()) {
      TaskTranslation translation = itr2.next();
      // translationService.delete(translation);
    }
  }