use of eu.bcvsolutions.idm.core.api.dto.filter.DataFilter 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()));
}
}
use of eu.bcvsolutions.idm.core.api.dto.filter.DataFilter in project CzechIdMng by bcvsolutions.
the class DefaultFilterManagerIntegrationTest method testFilterNotSupportedCheckDisabled.
@Test
public void testFilterNotSupportedCheckDisabled() {
try {
configurationService.setBooleanValue(FilterManager.PROPERTY_CHECK_SUPPORTED_FILTER_ENABLED, false);
DataFilter filter = new DataFilter(IdmConfigurationDto.class);
filter.set("wrong", "mock");
Page<IdmConfigurationDto> configurations = configurationService.find(filter, null);
//
Assert.assertNotNull(configurations);
} finally {
configurationService.setBooleanValue(FilterManager.PROPERTY_CHECK_SUPPORTED_FILTER_ENABLED, FilterManager.DEFAULT_CHECK_SUPPORTED_FILTER_ENABLED);
}
}
Aggregations