File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
integrationTest/groovy/com/bol/openapi
main/java/com/bol/openapi Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -119,4 +119,26 @@ class OpenApiClientIntegrationSpec extends Specification {
119
119
results. categories. size() == 0
120
120
results. refinementGroups. size() == 0
121
121
}
122
+
123
+ def ' Can get list of categories' () {
124
+ def results = OpenApiClient . withDefaultClient(apiKey). listBuilder(). dataType(QueryDataType.DataType . CATEGORIES )
125
+ .list()
126
+
127
+ expect :
128
+ results. totalResultSize > 0
129
+ results. products. size() == 0
130
+ results. categories. size() > 0
131
+ results. refinementGroups. size() == 0
132
+ }
133
+
134
+ def ' Can get list of products and refinements' () {
135
+ def results = OpenApiClient . withDefaultClient(apiKey). listBuilder(). dataType(QueryDataType.DataType . PRODUCTS ). dataType(QueryDataType.DataType . REFINEMENTS )
136
+ .list()
137
+
138
+ expect :
139
+ results. totalResultSize > 0
140
+ results. products. size() > 0
141
+ results. categories. size() == 0
142
+ results. refinementGroups. size() > 0
143
+ }
122
144
}
Original file line number Diff line number Diff line change @@ -67,6 +67,11 @@ public ListBuilder category(String id) {
67
67
return new ListBuilder (this );
68
68
}
69
69
70
+ public ListBuilder dataType (QueryDataType .DataType dataType ) {
71
+ dataTypes .add (dataType );
72
+ return new ListBuilder (this );
73
+ }
74
+
70
75
public ListBuilder allOffers () {
71
76
offerTypes .add (ALL );
72
77
return new ListBuilder (this );
You can’t perform that action at this time.
0 commit comments