Skip to content

Commit 7e804d7

Browse files
committed
ListBuilder and SearchBuilder made public for use in Java (closes #1)
Change-Id: Ie16fd3a52daf505276d790685d3ef4297d6004e0
1 parent 2587e7c commit 7e804d7

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To get the bol.com OpenAPI client binaries, add the JCenter repository (https://
1313
<dependency>
1414
<groupId>com.bol.openapi</groupId>
1515
<artifactId>openapi-java-client</artifactId>
16-
<version>4.0.0</version>
16+
<version>4.0.1</version>
1717
</dependency>
1818
```
1919

@@ -24,7 +24,7 @@ To get the bol.com OpenAPI client binaries, add the JCenter repository (https://
2424
jcenter()
2525
}
2626
dependencies {
27-
compile 'com.bol.openapi:openapi-java-client:4.0.0'
27+
compile 'com.bol.openapi:openapi-java-client:4.0.1'
2828
}
2929
```
3030

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
group=com.bol.openapi
2-
version=4.0.0
2+
version=4.0.1
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
package com.bol.external
22

33
import com.bol.openapi.OpenApiClient
4-
import spock.lang.Specification
4+
import groovy.transform.CompileStatic
5+
import org.junit.Before
6+
import org.junit.Test
57

6-
class OpenApiUserSpec extends Specification {
8+
@CompileStatic
9+
class OpenApiUserTest {
710

811
private String apiKey
912

10-
def setup() {
13+
@Before
14+
public void setup() {
1115
apiKey = System.getenv('OPENAPI_KEY')
1216
if (!apiKey) {
1317
apiKey = System.getProperty('OPENAPI_KEY')
@@ -18,19 +22,17 @@ class OpenApiUserSpec extends Specification {
1822
)
1923
}
2024

21-
def 'Can use searchBuilder outside the api package'() {
25+
@Test
26+
public void 'Can use searchBuilder outside the api package'() {
2227
def openApi = OpenApiClient.withDefaultClient(apiKey)
2328

24-
expect:
25-
def results = openApi.searchBuilder().term('harry potter').search()
26-
results.products
29+
assert openApi.searchBuilder().term('harry potter').search()
2730
}
2831

29-
def 'Can use listBuilder outside the api package'() {
32+
@Test
33+
public void 'Can use listBuilder outside the api package'() {
3034
def openApi = OpenApiClient.withDefaultClient(apiKey)
3135

32-
expect:
33-
def results = openApi.listBuilder().list()
34-
results.products
36+
assert openApi.listBuilder().list()
3537
}
3638
}

subprojects/client/src/main/java/com/bol/openapi/ListBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import static com.bol.openapi.QuerySortingMethod.SortingOrder.ASCENDING;
99
import static com.bol.openapi.QuerySortingMethod.SortingOrder.DESCENDING;
1010

11-
class ListBuilder {
11+
public class ListBuilder {
1212
private static final int OFFSET_DEFAULT = 0;
1313
private static final int LIMIT_DEFAULT = 10;
1414
private final OpenApiClient client;
@@ -21,11 +21,11 @@ class ListBuilder {
2121
private QueryLimit limit = QueryLimit.builder().limit(LIMIT_DEFAULT);
2222
private QueryIncludeAttribute includeAttributes = QueryIncludeAttribute.builder().exclude();
2323

24-
ListBuilder(OpenApiClient client) {
24+
public ListBuilder(OpenApiClient client) {
2525
this.client = client;
2626
}
2727

28-
ListBuilder(ListBuilder builder) {
28+
public ListBuilder(ListBuilder builder) {
2929
this.client = builder.client;
3030
this.productListType = builder.productListType;
3131
this.categoryIds = builder.categoryIds;

subprojects/client/src/main/java/com/bol/openapi/SearchBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import static com.bol.openapi.QuerySortingMethod.SortingOrder.ASCENDING;
88
import static com.bol.openapi.QuerySortingMethod.SortingOrder.DESCENDING;
99

10-
class SearchBuilder {
10+
public class SearchBuilder {
1111
private static final int OFFSET_DEFAULT = 0;
1212
private static final int LIMIT_DEFAULT = 10;
1313
private final OpenApiClient client;
@@ -22,11 +22,11 @@ class SearchBuilder {
2222
private QueryIncludeAttribute includeAttributes = QueryIncludeAttribute.builder().exclude();
2323
private QuerySearchField searchField = QuerySearchField.builder().none();
2424

25-
SearchBuilder(OpenApiClient client) {
25+
public SearchBuilder(OpenApiClient client) {
2626
this.client = client;
2727
}
2828

29-
SearchBuilder(SearchBuilder builder) {
29+
public SearchBuilder(SearchBuilder builder) {
3030
this.client = builder.client;
3131
this.query = builder.query;
3232
this.productIds = builder.productIds;

0 commit comments

Comments
 (0)