@Test(expected = SBonitaSearchException.class)
  public final void getNumberOfCommandsThrowException()
      throws SBonitaSearchException, SBonitaReadException {
    final QueryOptions options = mock(QueryOptions.class);
    when(persistence.getNumberOfEntities(SCommand.class, options, null))
        .thenThrow(new SBonitaReadException(""));

    commandServiceImpl.getNumberOfCommands(options);
  }
  /**
   * Test method for {@link
   * org.bonitasoft.engine.command.api.impl.CommandServiceImpl#getNumberOfCommands(org.bonitasoft.engine.persistence.QueryOptions)}.
   *
   * @throws SBonitaSearchException
   * @throws SBonitaReadException
   */
  @Test
  public final void getNumberOfCommands() throws SBonitaSearchException, SBonitaReadException {
    final long numberOfCommands = 54165L;
    final QueryOptions options = mock(QueryOptions.class);
    when(persistence.getNumberOfEntities(SCommand.class, options, null))
        .thenReturn(numberOfCommands);

    Assert.assertEquals(numberOfCommands, commandServiceImpl.getNumberOfCommands(options));
  }