@Test
public void findByType() {

    for (int i = 0; i < 20; i++) {
        createComponentDescriptor(ComponentType.FILTER, ComponentScope.SYSTEM, i);
        createComponentDescriptor(ComponentType.ACTION, ComponentScope.TENANT, i + 20);
    }
    TextPageLink pageLink1 = new TextPageLink(15, "COMPONENT_");
    List<ComponentDescriptor> components1 = componentDescriptorDao.findByTypeAndPageLink(ComponentType.FILTER, pageLink1);
    assertEquals(15, components1.size());
    TextPageLink pageLink2 = new TextPageLink(15, "COMPONENT_", components1.get(14).getId().getId(), null);
    List<ComponentDescriptor> components2 = componentDescriptorDao.findByTypeAndPageLink(ComponentType.FILTER, pageLink2);
    assertEquals(5, components2.size());
}