Skip to content

Commit 52d485b

Browse files
authored
JCL-402: JSONB test coverage (#1184)
Extend test coverage for all modules parsing Problem Details JSON to have them run against both jackson and jsonb. This includes the following modules: - solid - jena - rdf4j
1 parent 89534b4 commit 52d485b

File tree

4 files changed

+170
-10
lines changed

4 files changed

+170
-10
lines changed

jena/pom.xml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@
7373
<version>${project.version}</version>
7474
<scope>test</scope>
7575
</dependency>
76+
<dependency>
77+
<groupId>com.inrupt.client</groupId>
78+
<artifactId>inrupt-client-jsonb</artifactId>
79+
<version>${project.version}</version>
80+
<scope>test</scope>
81+
</dependency>
82+
<dependency>
83+
<groupId>org.eclipse</groupId>
84+
<artifactId>yasson</artifactId>
85+
<version>${yasson.version}</version>
86+
<scope>test</scope>
87+
</dependency>
7688
<dependency>
7789
<groupId>org.wiremock</groupId>
7890
<artifactId>wiremock</artifactId>
@@ -92,26 +104,54 @@
92104
<phase>none</phase>
93105
</execution>
94106
<execution>
95-
<id>httpclient-test</id>
107+
<id>httpclient-jackson-test</id>
108+
<phase>test</phase>
109+
<goals>
110+
<goal>test</goal>
111+
</goals>
112+
<configuration>
113+
<classpathDependencyExcludes>
114+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-okhttp</classpathDependencyExclude>
115+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jsonb</classpathDependencyExclude>
116+
</classpathDependencyExcludes>
117+
</configuration>
118+
</execution>
119+
<execution>
120+
<id>httpclient-jsonb-test</id>
96121
<phase>test</phase>
97122
<goals>
98123
<goal>test</goal>
99124
</goals>
100125
<configuration>
101126
<classpathDependencyExcludes>
102127
<classpathDependencyExclude>com.inrupt.client:inrupt-client-okhttp</classpathDependencyExclude>
128+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jackson</classpathDependencyExclude>
129+
</classpathDependencyExcludes>
130+
</configuration>
131+
</execution>
132+
<execution>
133+
<id>okhttp-jackson-test</id>
134+
<phase>test</phase>
135+
<goals>
136+
<goal>test</goal>
137+
</goals>
138+
<configuration>
139+
<classpathDependencyExcludes>
140+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-httpclient</classpathDependencyExclude>
141+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jsonb</classpathDependencyExclude>
103142
</classpathDependencyExcludes>
104143
</configuration>
105144
</execution>
106145
<execution>
107-
<id>okhhttp-test</id>
146+
<id>okhttp-jsonb-test</id>
108147
<phase>test</phase>
109148
<goals>
110149
<goal>test</goal>
111150
</goals>
112151
<configuration>
113152
<classpathDependencyExcludes>
114153
<classpathDependencyExclude>com.inrupt.client:inrupt-client-httpclient</classpathDependencyExclude>
154+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jackson</classpathDependencyExclude>
115155
</classpathDependencyExcludes>
116156
</configuration>
117157
</execution>

rdf4j/pom.xml

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,24 @@
150150
<version>${junit.version}</version>
151151
<scope>test</scope>
152152
</dependency>
153+
<dependency>
154+
<groupId>com.inrupt.client</groupId>
155+
<artifactId>inrupt-client-jackson</artifactId>
156+
<version>${project.version}</version>
157+
<scope>test</scope>
158+
</dependency>
159+
<dependency>
160+
<groupId>com.inrupt.client</groupId>
161+
<artifactId>inrupt-client-jsonb</artifactId>
162+
<version>${project.version}</version>
163+
<scope>test</scope>
164+
</dependency>
165+
<dependency>
166+
<groupId>org.eclipse</groupId>
167+
<artifactId>yasson</artifactId>
168+
<version>${yasson.version}</version>
169+
<scope>test</scope>
170+
</dependency>
153171
</dependencies>
154172

155173
<build>
@@ -163,26 +181,54 @@
163181
<phase>none</phase>
164182
</execution>
165183
<execution>
166-
<id>httpclient-test</id>
184+
<id>httpclient-jackson-test</id>
167185
<phase>test</phase>
168186
<goals>
169187
<goal>test</goal>
170188
</goals>
171189
<configuration>
172190
<classpathDependencyExcludes>
173191
<classpathDependencyExclude>com.inrupt.client:inrupt-client-okhttp</classpathDependencyExclude>
192+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jsonb</classpathDependencyExclude>
193+
</classpathDependencyExcludes>
194+
</configuration>
195+
</execution>
196+
<execution>
197+
<id>httpclient-jsonb-test</id>
198+
<phase>test</phase>
199+
<goals>
200+
<goal>test</goal>
201+
</goals>
202+
<configuration>
203+
<classpathDependencyExcludes>
204+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-okhttp</classpathDependencyExclude>
205+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jackson</classpathDependencyExclude>
206+
</classpathDependencyExcludes>
207+
</configuration>
208+
</execution>
209+
<execution>
210+
<id>okhttp-jackson-test</id>
211+
<phase>test</phase>
212+
<goals>
213+
<goal>test</goal>
214+
</goals>
215+
<configuration>
216+
<classpathDependencyExcludes>
217+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-httpclient</classpathDependencyExclude>
218+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jsonb</classpathDependencyExclude>
174219
</classpathDependencyExcludes>
175220
</configuration>
176221
</execution>
177222
<execution>
178-
<id>okhttp-test</id>
223+
<id>okhttp-jsonb-test</id>
179224
<phase>test</phase>
180225
<goals>
181226
<goal>test</goal>
182227
</goals>
183228
<configuration>
184229
<classpathDependencyExcludes>
185230
<classpathDependencyExclude>com.inrupt.client:inrupt-client-httpclient</classpathDependencyExclude>
231+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jackson</classpathDependencyExclude>
186232
</classpathDependencyExcludes>
187233
</configuration>
188234
</execution>

solid/pom.xml

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@
8585
<version>${project.version}</version>
8686
<scope>test</scope>
8787
</dependency>
88+
<dependency>
89+
<groupId>com.inrupt.client</groupId>
90+
<artifactId>inrupt-client-jsonb</artifactId>
91+
<version>${project.version}</version>
92+
<scope>test</scope>
93+
</dependency>
94+
<dependency>
95+
<groupId>org.eclipse</groupId>
96+
<artifactId>yasson</artifactId>
97+
<version>${yasson.version}</version>
98+
<scope>test</scope>
99+
</dependency>
88100
<dependency>
89101
<groupId>org.slf4j</groupId>
90102
<artifactId>slf4j-api</artifactId>
@@ -110,7 +122,7 @@
110122
<phase>none</phase>
111123
</execution>
112124
<execution>
113-
<id>httpclient-jena-test</id>
125+
<id>httpclient-jena-jackson-test</id>
114126
<phase>test</phase>
115127
<goals>
116128
<goal>test</goal>
@@ -119,11 +131,40 @@
119131
<classpathDependencyExcludes>
120132
<classpathDependencyExclude>com.inrupt.client:inrupt-client-okhttp</classpathDependencyExclude>
121133
<classpathDependencyExclude>com.inrupt.client:inrupt-client-rdf4j</classpathDependencyExclude>
134+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jsonb</classpathDependencyExclude>
135+
</classpathDependencyExcludes>
136+
</configuration>
137+
</execution>
138+
<execution>
139+
<id>httpclient-jena-jsonb-test</id>
140+
<phase>test</phase>
141+
<goals>
142+
<goal>test</goal>
143+
</goals>
144+
<configuration>
145+
<classpathDependencyExcludes>
146+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-okhttp</classpathDependencyExclude>
147+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-rdf4j</classpathDependencyExclude>
148+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jackson</classpathDependencyExclude>
149+
</classpathDependencyExcludes>
150+
</configuration>
151+
</execution>
152+
<execution>
153+
<id>httpclient-rdf4j-jackson-test</id>
154+
<phase>test</phase>
155+
<goals>
156+
<goal>test</goal>
157+
</goals>
158+
<configuration>
159+
<classpathDependencyExcludes>
160+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-okhttp</classpathDependencyExclude>
161+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jena</classpathDependencyExclude>
162+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jsonb</classpathDependencyExclude>
122163
</classpathDependencyExcludes>
123164
</configuration>
124165
</execution>
125166
<execution>
126-
<id>httpclient-rdf4j-test</id>
167+
<id>httpclient-rdf4j-jsonb-test</id>
127168
<phase>test</phase>
128169
<goals>
129170
<goal>test</goal>
@@ -132,11 +173,12 @@
132173
<classpathDependencyExcludes>
133174
<classpathDependencyExclude>com.inrupt.client:inrupt-client-okhttp</classpathDependencyExclude>
134175
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jena</classpathDependencyExclude>
176+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jackson</classpathDependencyExclude>
135177
</classpathDependencyExcludes>
136178
</configuration>
137179
</execution>
138180
<execution>
139-
<id>okhttp-jena-test</id>
181+
<id>okhttp-jena-jackson-test</id>
140182
<phase>test</phase>
141183
<goals>
142184
<goal>test</goal>
@@ -146,11 +188,42 @@
146188
<classpathDependencyExclude>com.inrupt.client:inrupt-client-httpclient</classpathDependencyExclude>
147189
<classpathDependencyExclude>com.inrupt.client:inrupt-client-rdf4j</classpathDependencyExclude>
148190
<classpathDependencyExclude>com.inrupt.client:inrupt-client-rdf-legacy</classpathDependencyExclude>
191+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jsonb</classpathDependencyExclude>
192+
</classpathDependencyExcludes>
193+
</configuration>
194+
</execution>
195+
<execution>
196+
<id>okhttp-jena-jsonb-test</id>
197+
<phase>test</phase>
198+
<goals>
199+
<goal>test</goal>
200+
</goals>
201+
<configuration>
202+
<classpathDependencyExcludes>
203+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-httpclient</classpathDependencyExclude>
204+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-rdf4j</classpathDependencyExclude>
205+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-rdf-legacy</classpathDependencyExclude>
206+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jackson</classpathDependencyExclude>
207+
</classpathDependencyExcludes>
208+
</configuration>
209+
</execution>
210+
<execution>
211+
<id>okhttp-rdf4j-jackson-test</id>
212+
<phase>test</phase>
213+
<goals>
214+
<goal>test</goal>
215+
</goals>
216+
<configuration>
217+
<classpathDependencyExcludes>
218+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-httpclient</classpathDependencyExclude>
219+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jena</classpathDependencyExclude>
220+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-rdf-legacy</classpathDependencyExclude>
221+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jsonb</classpathDependencyExclude>
149222
</classpathDependencyExcludes>
150223
</configuration>
151224
</execution>
152225
<execution>
153-
<id>okhttp-rdf4j-test</id>
226+
<id>okhttp-rdf4j-jsonb-test</id>
154227
<phase>test</phase>
155228
<goals>
156229
<goal>test</goal>
@@ -160,6 +233,7 @@
160233
<classpathDependencyExclude>com.inrupt.client:inrupt-client-httpclient</classpathDependencyExclude>
161234
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jena</classpathDependencyExclude>
162235
<classpathDependencyExclude>com.inrupt.client:inrupt-client-rdf-legacy</classpathDependencyExclude>
236+
<classpathDependencyExclude>com.inrupt.client:inrupt-client-jackson</classpathDependencyExclude>
163237
</classpathDependencyExcludes>
164238
</configuration>
165239
</execution>

solid/src/test/java/com/inrupt/client/solid/SolidClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626

2727
import com.inrupt.client.*;
2828
import com.inrupt.client.auth.Session;
29-
import com.inrupt.client.jackson.JacksonService;
3029
import com.inrupt.client.spi.JsonService;
3130
import com.inrupt.client.spi.RDFFactory;
31+
import com.inrupt.client.spi.ServiceProvider;
3232
import com.inrupt.client.util.URIBuilder;
3333
import com.inrupt.client.vocabulary.PIM;
3434

@@ -58,7 +58,7 @@ class SolidClientTest {
5858
private static final Map<String, String> config = new HashMap<>();
5959
private static final RDF rdf = RDFFactory.getInstance();
6060
private static final SolidClient client = SolidClient.getClient().session(Session.anonymous());
61-
private static final JsonService jsonService = new JacksonService();
61+
private static final JsonService jsonService = ServiceProvider.getJsonService();
6262

6363
@BeforeAll
6464
static void setup() {

0 commit comments

Comments
 (0)