use of eu.bcvsolutions.idm.core.model.repository.filter.GuaranteeManagersFilter in project CzechIdMng by bcvsolutions.
the class FilterBuilderControllerRestTest method testFindByName.
@Test
public void testFindByName() {
FilterBuilderFilter filter = new FilterBuilderFilter();
filter.setName(defaultManagersFilter.getName());
filter.setEntityClass(IdmIdentity.class.getCanonicalName());
List<FilterBuilderDto> results = find(filter);
//
Assert.assertFalse(results.isEmpty());
Assert.assertTrue(results.stream().anyMatch(f -> f.getFilterBuilderClass().equals(AutowireHelper.getTargetClass(defaultManagersFilter))));
Assert.assertTrue(results.stream().anyMatch(f -> f.getFilterBuilderClass().equals(AutowireHelper.getTargetClass(guaranteeManagersFilter))));
Assert.assertTrue(results.stream().allMatch(f -> f.getEntityClass().equals(IdmIdentity.class)));
Assert.assertTrue(results.stream().allMatch(f -> f.getName().equals(defaultManagersFilter.getName())));
//
// not-exists
filter.setName(getHelper().createName());
filter.setEntityClass(IdmIdentity.class.getCanonicalName());
results = find(filter);
Assert.assertTrue(results.isEmpty());
}
Aggregations