Fix conversion for boolean (and other types) for the jpa criteria

builder

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-02-01 16:17:07 +01:00
parent 518d4ca1e7
commit 21d19b2bd2
2 changed files with 39 additions and 23 deletions

View File

@@ -9,6 +9,7 @@
package org.eclipse.hawkbit.repository.rsql;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.Arrays;
@@ -94,7 +95,12 @@ public class RSQLDistributionSetFieldTest extends AbstractIntegrationTest {
@Description("Test filter distribution set by complete property")
public void testFilterByAttribute() {
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==true", 4);
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==noExist*", 0);
try {
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "==noExist*", 0);
fail();
} catch (final RSQLParameterSyntaxException e) {
// excepted
}
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "=in=(true)", 4);
assertRSQLQuery(DistributionSetFields.COMPLETE.name() + "=out=(true)", 0);
}