PivotSpecification pivotSpecification = dataModelObject.createPivotSpecification();
pivotSpecification.addCellValue("source", "Source Value", StatsFunction.DISTINCT_COUNT);
Assert.assertEquals(1, pivotSpecification.getCellValues().size());
for (PivotCellValue pcv : pivotSpecification.getCellValues()) {
JsonObject found = pcv.toJson();
JsonObject expected = new JsonObject();
expected.addProperty("fieldName", "source");
expected.addProperty("owner", "BaseEvent");
expected.addProperty("type", "string");
expected.addProperty("label", "Source Value");
expected.addProperty("value", "dc");
expected.addProperty("sparkline", false);
Assert.assertEquals(expected, found);
}
}