use of org.camunda.bpm.engine.filter.Filter in project camunda-bpm-platform by camunda.
the class FilterRestServiceInteractionTest method testGetFilterWithoutTenantIdQuery.
@Test
public void testGetFilterWithoutTenantIdQuery() {
TaskQueryImpl query = new TaskQueryImpl();
query.withoutTenantId();
Filter filter = new FilterEntity("Task").setName("test").setQuery(query);
when(filterServiceMock.getFilter(EXAMPLE_FILTER_ID)).thenReturn(filter);
given().pathParam("id", EXAMPLE_FILTER_ID).then().expect().statusCode(Status.OK.getStatusCode()).body("query.withoutTenantId", is(true)).when().get(SINGLE_FILTER_URL);
}
use of org.camunda.bpm.engine.filter.Filter in project camunda-bpm-platform by camunda.
the class FilterRestServiceInteractionTest method testGetFilterWithFollowUpBeforeOrNotExistentExpression.
@Test
public void testGetFilterWithFollowUpBeforeOrNotExistentExpression() {
TaskQueryImpl query = new TaskQueryImpl();
query.followUpBeforeOrNotExistentExpression("#{now()}");
Filter filter = new FilterEntity("Task").setName("test").setQuery(query);
when(filterServiceMock.getFilter(EXAMPLE_FILTER_ID)).thenReturn(filter);
given().pathParam("id", EXAMPLE_FILTER_ID).then().expect().statusCode(Status.OK.getStatusCode()).body("query.followUpBeforeOrNotExistentExpression", equalTo("#{now()}")).when().get(SINGLE_FILTER_URL);
}
use of org.camunda.bpm.engine.filter.Filter in project camunda-bpm-platform by camunda.
the class FilterRestServiceInteractionTest method testGetFilterWithSingleSorting.
@Test
public void testGetFilterWithSingleSorting() {
TaskQuery query = new TaskQueryImpl().orderByTaskName().desc();
Filter filter = new FilterEntity("Task").setName("test").setQuery(query);
when(filterServiceMock.getFilter(EXAMPLE_FILTER_ID)).thenReturn(filter);
Response response = given().pathParam("id", EXAMPLE_FILTER_ID).then().expect().statusCode(Status.OK.getStatusCode()).when().get(SINGLE_FILTER_URL);
// validate sorting content
String content = response.asString();
List<Map<String, Object>> sortings = from(content).getJsonObject("query.sorting");
assertThat(sortings).hasSize(1);
assertSorting(sortings.get(0), SORT_BY_NAME_VALUE, SORT_ORDER_DESC_VALUE);
}
use of org.camunda.bpm.engine.filter.Filter in project camunda-bpm-platform by camunda.
the class FilterRestServiceInteractionTest method testGetFilterWithoutSorting.
@Test
public void testGetFilterWithoutSorting() {
TaskQuery query = new TaskQueryImpl();
Filter filter = new FilterEntity("Task").setName("test").setQuery(query);
when(filterServiceMock.getFilter(EXAMPLE_FILTER_ID)).thenReturn(filter);
given().pathParam("id", EXAMPLE_FILTER_ID).then().expect().statusCode(Status.OK.getStatusCode()).body("query.sorting", isEmptyOrNullString()).when().get(SINGLE_FILTER_URL);
}
Aggregations