Search in sources :

Example 1 with TaskQueryFilterSpecBuilder

use of org.kie.server.api.util.TaskQueryFilterSpecBuilder in project droolsjbpm-integration by kiegroup.

the class MarshallerHelperTest method testJsonUnmarshallTaskQueryFilterSpec.

@Test
public void testJsonUnmarshallTaskQueryFilterSpec() {
    TaskQueryFilterSpec expectedTaskQfs = new TaskQueryFilterSpecBuilder().get();
    MarshallerHelper helper = new MarshallerHelper(null);
    String marshalledQFS = "{\"order-by\" : null, \"order-asc\" : false, \"query-params\" : null}";
    TaskQueryFilterSpec unmarshalledTaskQfs = helper.unmarshal(marshalledQFS, MarshallingFormat.JSON.toString(), TaskQueryFilterSpec.class);
    assertThat(expectedTaskQfs, new BaseMatcher<QueryFilterSpec>() {

        @Override
        public void describeTo(Description description) {
        }

        @Override
        public boolean matches(Object item) {
            return new ReflectionEquals(unmarshalledTaskQfs).matches(item);
        }
    });
}
Also used : TaskQueryFilterSpec(org.kie.server.api.model.definition.TaskQueryFilterSpec) Description(org.hamcrest.Description) ProcessInstanceQueryFilterSpec(org.kie.server.api.model.definition.ProcessInstanceQueryFilterSpec) TaskQueryFilterSpec(org.kie.server.api.model.definition.TaskQueryFilterSpec) QueryFilterSpec(org.kie.server.api.model.definition.QueryFilterSpec) ReflectionEquals(org.mockito.internal.matchers.apachecommons.ReflectionEquals) TaskQueryFilterSpecBuilder(org.kie.server.api.util.TaskQueryFilterSpecBuilder) Test(org.junit.Test)

Example 2 with TaskQueryFilterSpecBuilder

use of org.kie.server.api.util.TaskQueryFilterSpecBuilder in project droolsjbpm-integration by kiegroup.

the class TaskSearchServiceIntegrationTest method createQueryFilterAndEqualsTo.

private TaskQueryFilterSpec createQueryFilterAndEqualsTo(Map<TaskField, Comparable<?>> filterProperties) {
    TaskQueryFilterSpecBuilder result = new TaskQueryFilterSpecBuilder();
    filterProperties.forEach(result::equalsTo);
    return result.get();
}
Also used : TaskQueryFilterSpecBuilder(org.kie.server.api.util.TaskQueryFilterSpecBuilder)

Aggregations

TaskQueryFilterSpecBuilder (org.kie.server.api.util.TaskQueryFilterSpecBuilder)2 Description (org.hamcrest.Description)1 Test (org.junit.Test)1 ProcessInstanceQueryFilterSpec (org.kie.server.api.model.definition.ProcessInstanceQueryFilterSpec)1 QueryFilterSpec (org.kie.server.api.model.definition.QueryFilterSpec)1 TaskQueryFilterSpec (org.kie.server.api.model.definition.TaskQueryFilterSpec)1 ReflectionEquals (org.mockito.internal.matchers.apachecommons.ReflectionEquals)1