[#1650] Expose externalRef via search filters (#1657)

add option to filter actions using _externalref_ property

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-02-19 17:23:56 +02:00
committed by GitHub
parent a30ec4441e
commit ab61b168bd
3 changed files with 63 additions and 3 deletions

View File

@@ -62,6 +62,11 @@ public class RSQLActionFieldsTest extends AbstractJpaIntegrationTest {
newAction.setTarget(target);
newAction.setWeight(45);
newAction.setInitiatedBy(tenantAware.getCurrentUsername());
if ((i % 2) == 0) {
newAction.setExternalRef("extRef");
} else {
newAction.setExternalRef("extRef2");
}
actionRepository.save(newAction);
target.addAction(newAction);
}
@@ -100,6 +105,14 @@ public class RSQLActionFieldsTest extends AbstractJpaIntegrationTest {
fail("Missing expected RSQLParameterUnsupportedFieldException because status cannot be compared with 'true'");
} catch (final RSQLParameterUnsupportedFieldException e) {
}
}
@Test
@Description("Test action by status")
public void testFilterByParameterExtRef() {
assertRSQLQuery(ActionFields.EXTERNALREF.name() + "==extRef", 5);
assertRSQLQuery(ActionFields.EXTERNALREF.name() + "!=extRef", 6);
assertRSQLQuery(ActionFields.EXTERNALREF.name() + "==extRef*", 10);
}
private void assertRSQLQuery(final String rsqlParam, final long expectedEntities) {