File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
integrationTest/groovy/com/bol/openapi
main/java/com/bol/openapi Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,33 @@ class OpenApiClientIntegrationSpec extends Specification {
101101 product. offerData. offers. size() >= 1
102102 }
103103
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+
104131 def ' Can find out if the OpenAPI is healthy' () {
105132 def status = OpenApiClient . withDefaultClient(apiKey). getHealthStatus()
106133
Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ public SearchBuilder category(String id) {
5555 return new SearchBuilder (this );
5656 }
5757
58+ public SearchBuilder dataType (QueryDataType .DataType dataType ) {
59+ dataTypes .add (dataType );
60+ return new SearchBuilder (this );
61+ }
62+
5863 public SearchBuilder allOffers () {
5964 offerTypes .add (ALL );
6065 return new SearchBuilder (this );
Original file line number Diff line number Diff line change 7575 <xs : element name =" ShortDescription" type =" xs:string" minOccurs =" 0" maxOccurs =" 1" />
7676 <xs : element name =" LongDescription" type =" xs:string" minOccurs =" 0" maxOccurs =" 1" />
7777 <xs : element name =" TrackLists" type =" TrackList" minOccurs =" 0" maxOccurs =" unbounded" />
78+ <xs : element name =" energyLabelLetter" type =" xs:string" minOccurs =" 0" maxOccurs =" 1" />
7879 <xs : element name =" AttributeGroups" type =" AttributeGroup" minOccurs =" 0" maxOccurs =" unbounded" />
7980 <xs : element name =" EntityGroups" type =" EntityGroup" minOccurs =" 0" maxOccurs =" unbounded" />
8081 <xs : element name =" Urls" type =" Entry" minOccurs =" 0" maxOccurs =" unbounded" />
9899 <xs : element name =" Comment" type =" xs:string" minOccurs =" 0" maxOccurs =" 1" />
99100 <xs : element name =" Seller" type =" Seller" minOccurs =" 0" maxOccurs =" 1" />
100101 <xs : element name =" bestOffer" type =" xs:boolean" minOccurs =" 0" maxOccurs =" 1" />
102+ <xs : element name =" ReleaseDate" type =" xs:string" minOccurs =" 0" maxOccurs =" 1" />
101103 </xs : sequence >
102104 </xs : complexType >
103105
131133 <xs : element name =" warrantyConditions" type =" xs:string" minOccurs =" 0" maxOccurs =" 1" />
132134 <xs : element name =" repairConditions" type =" xs:string" minOccurs =" 0" maxOccurs =" 1" />
133135 <xs : element name =" approvalPercentage" type =" xs:string" minOccurs =" 0" maxOccurs =" 1" />
136+ <xs : element name =" registrationDate" type =" xs:string" minOccurs =" 0" maxOccurs =" 1" />
134137 </xs : sequence >
135138 </xs : complexType >
136139
265268 <xs : sequence >
266269 <xs : element name =" Category" minOccurs =" 0" maxOccurs =" 1" type =" Category" />
267270 <xs : element name =" RefinementGroups" minOccurs =" 0" maxOccurs =" unbounded" type =" RefinementGroup" />
271+ <xs : element name =" RetailId" minOccurs =" 0" maxOccurs =" 1" type =" xs:string" />
268272 </xs : sequence >
269273 </xs : complexType >
270274
You can’t perform that action at this time.
0 commit comments