Entity[] entities = new Entity[2];
entities[0] = e1;
entities[1] = e2;
DataWrapper dataWrapper = translator.createRuleData(entities, "orderItemMatchRule", "quantity", "id", orderItemFieldService);
assert(dataWrapper.getData().size() == 2);
assert(dataWrapper.getData().get(0).getQuantity() == 1);
assert(dataWrapper.getData().get(0).getGroupOperator().equals(BLCOperator.AND.name()));
assert(dataWrapper.getData().get(0).getGroups().size()==1);
assert(dataWrapper.getData().get(0).getGroups().get(0) instanceof ExpressionDTO);
ExpressionDTO exp1 = (ExpressionDTO) dataWrapper.getData().get(0).getGroups().get(0);
assert(exp1.getName().equals("category.name"));
assert(exp1.getOperator().equals(BLCOperator.EQUALS.name()));
assert(exp1.getValue().equals("test category"));
assert(dataWrapper.getData().get(1).getQuantity() == 2);
assert(dataWrapper.getData().get(1).getGroupOperator().equals(BLCOperator.NOT.name()));
assert(dataWrapper.getData().get(1).getGroups().size()==2);
assert(dataWrapper.getData().get(1).getGroups().get(0) instanceof ExpressionDTO);
ExpressionDTO expd1e1 = (ExpressionDTO) dataWrapper.getData().get(1).getGroups().get(0);
assert(expd1e1.getName().equals("product.manufacturer"));
assert(expd1e1.getOperator().equals(BLCOperator.EQUALS.name()));
assert(expd1e1.getValue().equals("test manufacturer"));
assert(dataWrapper.getData().get(1).getGroups().get(1) instanceof ExpressionDTO);
ExpressionDTO expd1e2 = (ExpressionDTO) dataWrapper.getData().get(1).getGroups().get(1);
assert(expd1e2.getName().equals("product.model"));
assert(expd1e2.getOperator().equals(BLCOperator.EQUALS.name()));
assert(expd1e2.getValue().equals("test model"));
}