Project

General

Profile

« Previous | Next » 

Revision ea92da24

Added by Andreas Kohlbecker over 5 years ago

fixing wrong boolean operator combination for Restrictions with operator AND_NOT

View differences:

cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/NameServiceImplTest.java
1022 1022
        result = nameService.findByTitleWithRestrictions(null, "Name", MatchMode.BEGINNING, restrictions, null, null, null, null);
1023 1023
        assertEquals(2l, result.getCount().longValue());
1024 1024

  
1025
        restrictions = Arrays.asList(new Restriction<String>("titleCache", Operator.AND_NOT, null, "Name1", "Name2"));
1026
        result = nameService.findByTitleWithRestrictions(null, "Name", MatchMode.BEGINNING, restrictions, null, null, null, null);
1027
        assertEquals(1l, result.getCount().longValue());
1028
        assertEquals("Name3", result.getRecords().get(0).getTitleCache());
1029

  
1025 1030
        restrictions = Arrays.asList(new Restriction<String>("typeDesignations.typeName.titleCache", Operator.OR, null, "Name1"));
1026 1031
        result = nameService.findByTitleWithRestrictions(null, "Name1", MatchMode.EXACT, restrictions, null, null, null, null);
1027 1032
        assertEquals(2l, result.getCount().longValue());

Also available in: Unified diff