File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
integrationTest/groovy/com/bol/openapi
main/java/com/bol/openapi Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,33 @@ class OpenApiClientIntegrationSpec extends Specification {
101
101
product. offerData. offers. size() >= 1
102
102
}
103
103
104
+ def ' Return products and categories' () {
105
+ def results = OpenApiClient . withDefaultClient(apiKey). searchBuilder()
106
+ .term(' harry potter' )
107
+ .dataType(QueryDataType.DataType . PRODUCTS )
108
+ .dataType(QueryDataType.DataType . CATEGORIES )
109
+ .search()
110
+
111
+ expect :
112
+ results. totalResultSize >= 1
113
+ results. products. size() > 0
114
+ results. categories. size() > 0
115
+ results. refinementGroups. size() == 0
116
+ }
117
+
118
+ def ' Return only refinements' () {
119
+ def results = OpenApiClient . withDefaultClient(apiKey). searchBuilder()
120
+ .term(' harry potter' )
121
+ .dataType(QueryDataType.DataType . REFINEMENTS )
122
+ .search()
123
+
124
+ expect :
125
+ results. totalResultSize >= 1
126
+ results. products. size() == 0
127
+ results. categories. size() == 0
128
+ results. refinementGroups. size() > 0
129
+ }
130
+
104
131
def ' Can find out if the OpenAPI is healthy' () {
105
132
def status = OpenApiClient . withDefaultClient(apiKey). getHealthStatus()
106
133
Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ public SearchBuilder category(String id) {
55
55
return new SearchBuilder (this );
56
56
}
57
57
58
+ public SearchBuilder dataType (QueryDataType .DataType dataType ) {
59
+ dataTypes .add (dataType );
60
+ return new SearchBuilder (this );
61
+ }
62
+
58
63
public SearchBuilder allOffers () {
59
64
offerTypes .add (ALL );
60
65
return new SearchBuilder (this );
You can’t perform that action at this time.
0 commit comments