File tree Expand file tree Collapse file tree
main/java/com/gooddata/executeafm/result
test/groovy/com/gooddata/executeafm/result Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import com .fasterxml .jackson .annotation .JsonTypeInfo ;
1010import com .gooddata .util .GoodDataToStringBuilder ;
1111
12- import static com .gooddata .util .Validate .notEmpty ;
12+ import static com .gooddata .util .Validate .notNull ;
1313
1414/**
1515 * Represent header items available in {@link ExecutionResult}
@@ -25,7 +25,7 @@ public abstract class ResultHeaderItem {
2525 private final String name ;
2626
2727 protected ResultHeaderItem (final String name ) {
28- this .name = notEmpty (name , "name" );
28+ this .name = notNull (name , "name" );
2929 }
3030
3131 /**
Original file line number Diff line number Diff line change @@ -25,4 +25,17 @@ class ResultHeaderItemTest extends Specification {
2525 typeClass << [AttributeHeaderItem , ResultMeasureHeaderItem , ResultTotalHeaderItem ]
2626 type = typeClass. simpleName. uncapitalize()
2727 }
28+
29+ def " should allow empty name" () {
30+ expect :
31+ new ResultHeaderItem (' ' ) {}. name == ' '
32+ }
33+
34+ def " should not allow null name" () {
35+ when :
36+ new ResultHeaderItem (null ) {}
37+
38+ then :
39+ thrown(IllegalArgumentException )
40+ }
2841}
You can’t perform that action at this time.
0 commit comments