Fix limited DS complete filtering when and becomes comparison (#2780)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -1344,7 +1344,14 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe
|
||||
.andExpect(jsonPath("size", equalTo(10)))
|
||||
.andExpect(jsonPath("total", equalTo(10)));
|
||||
|
||||
// and more complex (case insensitive) query
|
||||
// and more complex (logical and to comparison conversion) query
|
||||
mvc.perform(get("/rest/v1/distributionsets?q=complete==true;valid==true"))
|
||||
.andDo(MockMvcResultPrinter.print())
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("size", equalTo(10)))
|
||||
.andExpect(jsonPath("total", equalTo(10)));
|
||||
|
||||
// and more complex (case-insensitive) query
|
||||
mvc.perform(get("/rest/v1/distributionsets?q=complete==true;valid==true;id=IN=(" + String.join(",", dsIds) + ")"))
|
||||
.andDo(MockMvcResultPrinter.print())
|
||||
.andExpect(status().isOk())
|
||||
|
||||
@@ -135,8 +135,11 @@ public class JpaDistributionSetManagement
|
||||
sanitizedChildren.add(child);
|
||||
}
|
||||
});
|
||||
specList.add(QLSupport.getInstance()
|
||||
.buildSpec(new Node.Logical(Node.Logical.Operator.AND, sanitizedChildren), DistributionSetFields.class));
|
||||
specList.add(QLSupport.getInstance().buildSpec(
|
||||
sanitizedChildren.size() == 1
|
||||
? sanitizedChildren.get(0)
|
||||
: new Node.Logical(Node.Logical.Operator.AND, sanitizedChildren),
|
||||
DistributionSetFields.class));
|
||||
}
|
||||
if (completedComparison.get() != null) { // really a comparison
|
||||
log.warn("Usage of 'complete' in RSQL is deprecated and will be removed in future: {}", node);
|
||||
|
||||
Reference in New Issue
Block a user