use of eu.bcvsolutions.idm.core.api.dto.FilterBuilderDto in project CzechIdMng by bcvsolutions.
the class DefaultFilterManagerIntegrationTest method testGetNullPredicate.
/**
* Test all registered filters - filter has to be checked for null values.
*/
@Test
@SuppressWarnings({ "rawtypes", "unchecked" })
public void testGetNullPredicate() throws Exception {
for (FilterBuilderDto filterBuilderDto : filterManager.find(null)) {
FilterBuilder filterBuilder = filterManager.getBuilder(filterBuilderDto.getEntityClass(), filterBuilderDto.getName());
if (filterBuilder == null) {
// ~ service impl
continue;
}
if (!DataFilter.class.isAssignableFrom(filterBuilderDto.getFilterClass())) {
// ~ not registrable
continue;
}
if (DataFilter.class.equals(filterBuilderDto.getFilterClass())) {
// TODO: construct abstract data filter
continue;
}
//
Class<? extends DataFilter> filterClass = (Class<? extends DataFilter>) filterBuilderDto.getFilterClass();
Assert.assertNull(filterBuilder.getPredicate(null, null, null, filterClass.getDeclaredConstructor().newInstance()));
}
}
Aggregations