use of com.qcadoo.model.api.search.SearchRestrictions in project qcadoo by qcadoo.
the class EntityListImplTest method init.
@Before
public void init() {
dataAccessService = mock(DataAccessService.class);
SearchRestrictions restrictions = new SearchRestrictions();
ReflectionTestUtils.setField(restrictions, "dataAccessService", dataAccessService);
}
use of com.qcadoo.model.api.search.SearchRestrictions in project qcadoo by qcadoo.
the class DataAccessTest method superInit.
@Before
public void superInit() {
pluginStateResolver = Mockito.mock(PluginStateResolver.class);
given(pluginStateResolver.isEnabled(Mockito.anyString())).willReturn(true);
given(pluginStateResolver.isEnabled(Mockito.any(Plugin.class))).willReturn(true);
given(pluginStateResolver.isEnabledOrEnabling(Mockito.anyString())).willReturn(true);
given(pluginStateResolver.isEnabledOrEnabling(Mockito.any(Plugin.class))).willReturn(true);
PluginUtilsService pluginUtilsService = new PluginUtilsService(pluginStateResolver);
pluginUtilsService.init();
validationService = new ValidationServiceImpl();
entityService = new EntityServiceImpl();
ReflectionTestUtils.setField(entityService, "hibernateService", hibernateService);
priorityService = new PriorityServiceImpl();
ReflectionTestUtils.setField(priorityService, "entityService", entityService);
ReflectionTestUtils.setField(priorityService, "hibernateService", hibernateService);
dataAccessService = new DataAccessServiceImpl();
ReflectionTestUtils.setField(dataAccessService, "entityService", entityService);
ReflectionTestUtils.setField(dataAccessService, "priorityService", priorityService);
ReflectionTestUtils.setField(dataAccessService, "validationService", validationService);
ReflectionTestUtils.setField(dataAccessService, "hibernateService", hibernateService);
AnnotationTransactionAspect.aspectOf();
SearchRestrictions restrictions = new SearchRestrictions();
ReflectionTestUtils.setField(restrictions, "dataAccessService", dataAccessService);
buildParentDataDefinition();
buildTreeDataDefinition();
buildDataDefinition();
given(hibernateService.getCurrentSession()).willReturn(session);
given(session.createCriteria(any(Class.class))).willReturn(criteria);
given(criteria.add(any(Criterion.class))).willReturn(criteria);
given(criteria.setProjection(any(Projection.class))).willReturn(criteria);
given(criteria.setFirstResult(anyInt())).willReturn(criteria);
given(criteria.setMaxResults(anyInt())).willReturn(criteria);
given(criteria.addOrder(any(Order.class))).willReturn(criteria);
}
use of com.qcadoo.model.api.search.SearchRestrictions in project qcadoo by qcadoo.
the class EntityTreeImplTest method init.
@Before
public void init() {
dataAccessService = mock(DataAccessService.class);
SearchRestrictions restrictions = new SearchRestrictions();
ReflectionTestUtils.setField(restrictions, "dataAccessService", dataAccessService);
}
Aggregations