@Test(expected = SCommandGettingException.class)
  public final void getUserCommandsThrowException()
      throws SCommandGettingException, SBonitaReadException {
    when(persistence.selectList(any(SelectListDescriptor.class)))
        .thenThrow(new SBonitaReadException(""));

    commandServiceImpl.getUserCommands(0, 1, SCommandCriterion.NAME_DESC);
  }
  /**
   * Test method for {@link
   * org.bonitasoft.engine.command.api.impl.CommandServiceImpl#getUserCommands(int, int,
   * org.bonitasoft.engine.command.model.SCommandCriterion)}.
   *
   * @throws SCommandGettingException
   * @throws SBonitaReadException
   */
  @Test
  public final void getUserCommands() throws SCommandGettingException, SBonitaReadException {
    final List<SCommand> sCommands = new ArrayList<SCommand>();
    when(persistence.selectList(any(SelectListDescriptor.class))).thenReturn(sCommands);

    Assert.assertEquals(
        sCommands, commandServiceImpl.getUserCommands(0, 1, SCommandCriterion.NAME_ASC));
  }