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 {
119119 results. categories. size() == 0
120120 results. refinementGroups. size() == 0
121121 }
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+ }
122144}
Original file line number Diff line number Diff line change @@ -67,6 +67,11 @@ public ListBuilder category(String id) {
6767 return new ListBuilder (this );
6868 }
6969
70+ public ListBuilder dataType (QueryDataType .DataType dataType ) {
71+ dataTypes .add (dataType );
72+ return new ListBuilder (this );
73+ }
74+
7075 public ListBuilder allOffers () {
7176 offerTypes .add (ALL );
7277 return new ListBuilder (this );
You can’t perform that action at this time.
0 commit comments