Search in sources :

Example 1 with ProcessInstanceQueryFilterSpecBuilder

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

the class MarshallerHelperTest method testJsonUnmarshallProcessInstanceQueryFilterSpec.

@Test
public void testJsonUnmarshallProcessInstanceQueryFilterSpec() {
    ProcessInstanceQueryFilterSpec expectedPiQfs = new ProcessInstanceQueryFilterSpecBuilder().get();
    MarshallerHelper helper = new MarshallerHelper(null);
    String marshalledQFS = "{\"order-by\" : null,\"order-asc\" : false,\"query-params\" : null}";
    ProcessInstanceQueryFilterSpec unmarshalledPiQfs = helper.unmarshal(marshalledQFS, MarshallingFormat.JSON.toString(), ProcessInstanceQueryFilterSpec.class);
    assertThat(expectedPiQfs, new BaseMatcher<QueryFilterSpec>() {

        @Override
        public void describeTo(Description description) {
        }

        @Override
        public boolean matches(Object item) {
            return new ReflectionEquals(unmarshalledPiQfs).matches(item);
        }
    });
}
Also used : 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) ProcessInstanceQueryFilterSpecBuilder(org.kie.server.api.util.ProcessInstanceQueryFilterSpecBuilder) ReflectionEquals(org.mockito.internal.matchers.apachecommons.ReflectionEquals) ProcessInstanceQueryFilterSpec(org.kie.server.api.model.definition.ProcessInstanceQueryFilterSpec) Test(org.junit.Test)

Example 2 with ProcessInstanceQueryFilterSpecBuilder

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

the class ProcessSearchServiceIntegrationTest method createQueryFilterAndEqualsTo.

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

Aggregations

ProcessInstanceQueryFilterSpecBuilder (org.kie.server.api.util.ProcessInstanceQueryFilterSpecBuilder)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