@Test
public void testGetCommandHistory_pagination() {

	Manager manager = Mockito.mock( Manager.class );
	ICommandsMngr commandsMngr = Mockito.mock( ICommandsMngr.class );
	Mockito.when( manager.commandsMngr()).thenReturn( commandsMngr );
	this.resource = new HistoryResource( manager );
	// There is no data source
	List<CommandHistoryItem> items = this.resource.getCommandHistory( 10, null, 10, "start", null );
	Assert.assertEquals( 0, items.size());
	Mockito.verify( commandsMngr ).getHistory( 90, 10, "start", null, null );
	Mockito.reset( commandsMngr );
	items = this.resource.getCommandHistory( -2, null, 10, null, "asc" );
	Assert.assertEquals( 0, items.size());
	Mockito.verify( commandsMngr ).getHistory( 0, 10, null, "asc", null );
	Mockito.reset( commandsMngr );
	items = this.resource.getCommandHistory( 1, null, 10, null, "asc" );
	Assert.assertEquals( 0, items.size());
	Mockito.verify( commandsMngr ).getHistory( 0, 10, null, "asc", null );
	Mockito.reset( commandsMngr );
	items = this.resource.getCommandHistory( 2, "app", 10, null, "asc" );
	Assert.assertEquals( 0, items.size());
	Mockito.verify( commandsMngr ).getHistory( 10, 10, null, "asc", "app" );
}