use of org.kie.server.api.model.definition.QueryFilterSpec 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);
}
});
}
use of org.kie.server.api.model.definition.QueryFilterSpec in project droolsjbpm-integration by kiegroup.
the class MarshallerHelperTest method testMarshallWithoutContainer.
@Test
public void testMarshallWithoutContainer() {
KieServerRegistry kieServerRegistryMock = Mockito.mock(KieServerRegistry.class);
MarshallerHelper helper = new MarshallerHelper(kieServerRegistryMock);
QueryFilterSpec queryFilterSpec = new QueryFilterSpecBuilder().get();
String marshalledQFS = helper.marshal(MarshallingFormat.JAXB.toString(), queryFilterSpec);
String expectedMarshalledQFS = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<query-filter-spec>" + "<order-asc>false</order-asc>" + "</query-filter-spec>";
assertThat(marshalledQFS, CompareMatcher.isIdenticalTo(expectedMarshalledQFS).ignoreWhitespace());
}
use of org.kie.server.api.model.definition.QueryFilterSpec in project droolsjbpm-integration by kiegroup.
the class MarshallerHelperTest method testJsonUnmarshallQueryFilterSpec.
@Test
public void testJsonUnmarshallQueryFilterSpec() {
MarshallerHelper helper = new MarshallerHelper(null);
String marshalledQFS = "{\"order-by\" : null, \"order-asc\" : false, \"query-params\" : null, \"result-column-mapping\" : null}";
QueryFilterSpec qfs = helper.unmarshal(marshalledQFS, MarshallingFormat.JSON.toString(), QueryFilterSpec.class);
// TODO: assert value.
}
use of org.kie.server.api.model.definition.QueryFilterSpec 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);
}
});
}
use of org.kie.server.api.model.definition.QueryFilterSpec in project droolsjbpm-integration by kiegroup.
the class MarshallerHelperTest method testMarshallWithNullRegistry.
/**
* Tests that MarshallerHelper can also be used when passing in a <code>null</code> KieServerRegistry.
*/
@Test
public void testMarshallWithNullRegistry() {
MarshallerHelper helper = new MarshallerHelper(null);
QueryFilterSpec queryFilterSpec = new QueryFilterSpecBuilder().get();
String marshalledQFS = helper.marshal(MarshallingFormat.JAXB.toString(), queryFilterSpec);
String expectedMarshalledQFS = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<query-filter-spec>" + "<order-asc>false</order-asc>" + "</query-filter-spec>";
assertThat(marshalledQFS, CompareMatcher.isIdenticalTo(expectedMarshalledQFS).ignoreWhitespace());
}
Aggregations