File tree Expand file tree Collapse file tree
main/java/com/gooddata/executeafm/response
test/groovy/com/gooddata/executeafm/response Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import com .fasterxml .jackson .annotation .JsonProperty ;
1010import com .fasterxml .jackson .annotation .JsonTypeInfo ;
1111import com .fasterxml .jackson .annotation .JsonTypeName ;
12+ import com .gooddata .md .report .Total ;
1213import com .gooddata .util .GoodDataToStringBuilder ;
1314
15+ import static com .gooddata .util .Validate .notNull ;
16+
1417/**
1518 * Header of total
1619 */
@@ -29,6 +32,14 @@ public TotalHeaderItem(@JsonProperty("name") final String name) {
2932 this .name = name ;
3033 }
3134
35+ /**
36+ * Creates new header
37+ * @param total total value
38+ */
39+ public TotalHeaderItem (final Total total ) {
40+ this (notNull (total , "total" ).toString ());
41+ }
42+
3243 /**
3344 * @return name of total
3445 */
Original file line number Diff line number Diff line change 55 */
66package com.gooddata.executeafm.response
77
8+ import com.gooddata.md.report.Total
89import spock.lang.Specification
910
1011import static com.gooddata.util.ResourceUtils.readObjectFromResource
@@ -18,7 +19,7 @@ class TotalHeaderItemTest extends Specification {
1819
1920 def " should serialize" () {
2021 expect :
21- that new TotalHeaderItem (' avg ' ),
22+ that new TotalHeaderItem (Total . AVG ),
2223 jsonEquals(resource(TOTAL_HEADER_ITEM_JSON ))
2324 }
2425
You can’t perform that action at this time.
0 commit comments