use of com.synopsys.integration.azure.boards.common.service.query.fluent.WorkItemQuery in project hub-alert by blackducksoftware.
the class WorkItemQueryTest method whereMultiGroupTest.
@Test
public void whereMultiGroupTest() {
String expectedQueryString = "SELECT [Field]" + " FROM WorkItems" + " WHERE ( [Field] = 'a value' OR [Other Field] Contains 'something else' )" + " AND [Thing] Was Ever 'not a thing'" + " AND ( [Something] Does Not Contain 'forbidden phrase' AND [Something Else] <> '' )" + " ORDER BY [Other Field]";
WorkItemQuery workItemQuery = WorkItemQuery.select("Field").fromWorkItems().whereGroup("Field", WorkItemQueryWhereOperator.EQ, "a value").or("Other Field", WorkItemQueryWhereOperator.CONTAINS, "something else").endGroup().and("Thing", WorkItemQueryWhereOperator.WAS_EVER, "not a thing").beginGroup().and("Something", WorkItemQueryWhereOperator.DOES_NOT_CONTAIN, "forbidden phrase").and("Something Else", WorkItemQueryWhereOperator.NOT_EQUALS, null).orderBy("Other Field").build();
assertEquals(expectedQueryString, workItemQuery.toString());
}
Aggregations