Skip to content

Commit a269e04

Browse files
committed
Details.
1 parent fa9dec8 commit a269e04

File tree

17 files changed

+124
-129
lines changed

17 files changed

+124
-129
lines changed

client-core/src/test/java/nl/vpro/api/client/utils/ConfigTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
1818
*/
1919
@Slf4j
20-
public class ConfigTest {
20+
class ConfigTest {
2121

2222

2323
@Test
24-
public void env() {
24+
void env() {
2525
Config config = new Config("apiclient-test.properties", "apiclient-test2.properties");
2626
Map<String, String> props = config.getProperties(api);
2727
log.info("{}", props);
@@ -32,7 +32,7 @@ public void env() {
3232
}
3333

3434
@Test
35-
public void setEnv() {
35+
void setEnv() {
3636
Config config = new Config("apiclient-test.properties", "apiclient-test2.properties");
3737

3838
config.setEnv(Env.TEST);
@@ -47,7 +47,7 @@ public void setEnv() {
4747

4848

4949
@Test
50-
public void envPerPrefix() {
50+
void envPerPrefix() {
5151

5252
Config config = new Config("apiclient-test-env-prefix.properties");
5353
assertThat(config.env(api)).isEqualTo(Env.TEST);
@@ -65,7 +65,7 @@ public void envPerPrefix() {
6565
}
6666

6767
@Test
68-
public void withSubst() {
68+
void withSubst() {
6969

7070
Config config = new Config("with-subst.properties");
7171
assertThat(config.requiredOption(api, "es.env")).isEqualTo("prod");

client-core/src/test/java/nl/vpro/api/client/utils/SwaggerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
* @author Michiel Meeuwissen
1111
* @since 5.7
1212
*/
13-
public class SwaggerTest {
13+
class SwaggerTest {
1414

1515
@Test
16-
public void getVersion() {
16+
void getVersion() {
1717

1818
assertThat(Swagger.getVersion("5.6-SNAPSHOT.${builder.vcs.number}", null)).isEqualTo("5.6");
1919

@@ -25,7 +25,7 @@ public void getVersion() {
2525
}
2626

2727
@Test
28-
public void getVersionFromSwagger() {
28+
void getVersionFromSwagger() {
2929
assertThat(Swagger.getVersionFromSwagger("https://rs.poms.omroep.nl/v1/api", "5.6", null).getVersion()).isNotEqualTo("5.6");
3030
}
3131
}

client-extras/src/test/java/nl/vpro/api/client/utils/MediaRestClientUtilsTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package nl.vpro.api.client.utils;
22

3+
import jakarta.ws.rs.core.Response;
4+
35
import java.net.URL;
46
import java.time.Instant;
57

6-
import jakarta.ws.rs.core.Response;
7-
88
import org.junit.jupiter.api.Disabled;
99
import org.junit.jupiter.api.Test;
1010

@@ -19,10 +19,10 @@
1919

2020

2121
@Disabled
22-
public class MediaRestClientUtilsTest {
22+
class MediaRestClientUtilsTest {
2323

2424
@Test
25-
public void testChanges() throws Exception {
25+
void testChanges() throws Exception {
2626

2727
MediaRestService mediaRestService = mock(MediaRestService.class);
2828

@@ -56,12 +56,12 @@ public void testChanges() throws Exception {
5656
}
5757

5858
@Test
59-
public void testLoad() {
59+
void testLoad() {
6060
}
6161

6262

6363
@Test
64-
public void testLoadSubitltes() {
64+
void testLoadSubitltes() {
6565

6666
}
6767
}

client-extras/src/test/java/nl/vpro/api/client/utils/NpoApiClientUtilTest.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package nl.vpro.api.client.utils;
22

3+
import jakarta.ws.rs.client.Client;
4+
import jakarta.ws.rs.core.*;
35
import lombok.extern.slf4j.Slf4j;
46

57
import java.io.IOException;
@@ -9,9 +11,6 @@
911
import java.time.Instant;
1012
import java.util.*;
1113

12-
import jakarta.ws.rs.client.Client;
13-
import jakarta.ws.rs.core.*;
14-
1514
import org.apache.commons.io.IOUtils;
1615
import org.apache.commons.lang3.time.StopWatch;
1716
import org.apache.http.HttpResponse;
@@ -30,8 +29,8 @@
3029
import nl.vpro.domain.api.Order;
3130
import nl.vpro.domain.api.media.*;
3231
import nl.vpro.domain.api.profile.Profile;
33-
import nl.vpro.domain.media.MediaType;
3432
import nl.vpro.domain.media.*;
33+
import nl.vpro.domain.media.MediaType;
3534
import nl.vpro.util.CloseableIterator;
3635
import nl.vpro.util.CountedIterator;
3736

@@ -50,7 +49,7 @@ public class NpoApiClientUtilTest {
5049

5150

5251
@BeforeEach
53-
public void setUp() {
52+
void setUp() {
5453

5554
util = new NpoApiMediaUtil(NpoApiClients.configured().warnThreshold(Duration.ofMillis(1)).build(), new NpoApiRateLimiter());
5655

@@ -61,12 +60,12 @@ public void setUp() {
6160
log.info("Testing {}", util);
6261
}
6362
@AfterEach
64-
public void after() {
63+
void after() {
6564
log.info("Test took {}", Duration.between(start, Instant.now()));
6665
}
6766

6867
@Test
69-
public void testLoadMultiple() throws Exception {
68+
void testLoadMultiple() throws Exception {
7069
MediaObject[] result = util.load("AVRO_1656037", "AVRO_1656037", "POMS_VPRO_487567");
7170
assertThat(result[0].getMid()).isEqualTo("AVRO_1656037");
7271
assertThat(result[1].getMid()).isEqualTo("AVRO_1656037");
@@ -81,7 +80,7 @@ public void testLoadMultiple() throws Exception {
8180

8281

8382
@Test
84-
public void testLoadMultipleWithTimeout() {
83+
void testLoadMultipleWithTimeout() {
8584
assertThatThrownBy(() -> {
8685
MediaObject[] result = utilShortTimeout.load("AVRO_1656037", "AVRO_1656037", "POMS_VPRO_487567");
8786
log.info("{}", Arrays.asList(result));
@@ -90,21 +89,21 @@ public void testLoadMultipleWithTimeout() {
9089

9190

9291
@Test
93-
public void testLoad() throws Exception {
92+
void testLoad() throws Exception {
9493
MediaObject result = util.loadOrNull("AVRO_1656037");
9594
assertThat(result.getMid()).isEqualTo("AVRO_1656037");
9695
}
9796

9897

9998
@Test
100-
public void testLoadNotFound() throws Exception {
99+
void testLoadNotFound() throws Exception {
101100
MediaObject result = util.loadOrNull("bestaat niet");
102101
assertThat(result).isNull();
103102
}
104103

105104

106105
@Test
107-
public void testLoadWithTimeout() {
106+
void testLoadWithTimeout() {
108107
assertThatThrownBy(() -> {
109108

110109
MediaObject result = utilShortTimeout.loadOrNull("AVRO_1656037");
@@ -118,7 +117,7 @@ public void testLoadWithTimeout() {
118117
@SuppressWarnings("deprecation")
119118
@Test
120119
@Disabled("Takes long!!")
121-
public void testChanges() throws Exception {
120+
void testChanges() throws Exception {
122121
try (CloseableIterator<MediaChange> result = util.changes("woord", 1433329965809L, Order.ASC, Integer.MAX_VALUE)) {
123122
long i = 0;
124123
while (result.hasNext()) {
@@ -136,7 +135,7 @@ public void testChanges() throws Exception {
136135

137136
@Test
138137
@Disabled("Takes long!!")
139-
public void testChangesEpoch() throws Exception {
138+
void testChangesEpoch() throws Exception {
140139
try (CountedIterator<MediaChange> result = util.changes("woord", Instant.EPOCH, Order.ASC, null)) {
141140
long i = 0;
142141
while (result.hasNext()) {
@@ -153,7 +152,7 @@ public void testChangesEpoch() throws Exception {
153152

154153
@Test
155154
@Disabled("Takes long!!")
156-
public void testChangesVpronl() throws Exception {
155+
void testChangesVpronl() throws Exception {
157156
try (CountedIterator<MediaChange> result = util.changes("vpro-predictions", Instant.now().minus(Duration.ofHours(6)), Order.ASC, null)) {
158157
long i = 0;
159158
while (result.hasNext()) {
@@ -167,7 +166,7 @@ public void testChangesVpronl() throws Exception {
167166

168167
@Test
169168
@Disabled("Takes long!")
170-
public void testIterate() throws Exception {
169+
void testIterate() throws Exception {
171170
Instant start = Instant.now();
172171
try (CloseableIterator<MediaObject> result = util.iterate(new MediaForm(), null)) {
173172
long i = 0;
@@ -190,15 +189,15 @@ public void testIterate() throws Exception {
190189

191190

192191
@Test
193-
public void testListDescendants() {
192+
void testListDescendants() {
194193
MediaResult result = util.listDescendants("RBX_S_NTR_553927", Order.DESC, input -> input.getMediaType() == MediaType.BROADCAST, 123);
195194
assertThat(result.getSize()).isEqualTo(123);
196195

197196

198197
}
199198

200199
@Test
201-
public void testListRelated() {
200+
void testListRelated() {
202201
MediaSearchResult result = util.getClients().getMediaService().findRelated(MediaFormBuilder.emptyForm(), "VPWON_1174495", "vpro", null, 10, null);
203202
log.info("{}", result.asList().get(0).getDescendantOf().iterator().next().getMidRef());
204203
}
@@ -209,7 +208,7 @@ public void testListRelated() {
209208
//@Test
210209
@Disabled("This doesn't test the api, but httpclient")
211210
// this does indeed timeout
212-
public void timeout() {
211+
void timeout() {
213212
assertThatThrownBy(() -> {
214213
HttpClient client;
215214
{
@@ -245,7 +244,7 @@ public void timeout() {
245244
//@Test(expected = IOException.class)
246245
@Test
247246
@Disabled("Doesn't test api, but httpclient")
248-
public void timeoutWithInvoke() throws URISyntaxException {
247+
void timeoutWithInvoke() throws URISyntaxException {
249248
ApacheHttpClient43Engine engine = (ApacheHttpClient43Engine ) utilShortTimeout.getClients().getClientHttpEngine();
250249
String host = utilShortTimeout.getClients().getBaseUrl() + "/media/AVRO_1656037";
251250
URI uri = new URI(host);
@@ -271,13 +270,13 @@ public void timeoutWithInvoke() throws URISyntaxException {
271270

272271

273272
@Test
274-
public void testLoadProfile() {
273+
void testLoadProfile() {
275274
Profile profile = util.getClients().getProfileService().load("human");
276275
System.out.println(profile.getMediaProfile());
277276
}
278277

279278
@Test
280-
public void badRequest() {
279+
void badRequest() {
281280
assertThatThrownBy(() -> {
282281

283282
//MediaForm form = Jackson2Mapper.getInstance().readValue("{\"searches\":{\"mediaIds\":[{\"value\":\"VPWON_1181924\",\"match\":\"not\"}],\"types\":[{\"value\":\"BROADCAST\",\"match\":\"should\"},{\"value\":\"CLIP\",\"match\":\"should\"},{\"value\":\"SEGMENT\",\"match\":\"should\"},{\"value\":\"TRACK\",\"match\":\"should\"}]}}", MediaForm.class);
@@ -288,7 +287,7 @@ public void badRequest() {
288287
}
289288

290289
@Test
291-
public void loadSubtiles() {
290+
void loadSubtiles() {
292291

293292
System.out.println(util.getClients().getSubtitlesRestService().get("WO_VPRO_025700", Locale.JAPAN));
294293
}

client-extras/src/test/java/nl/vpro/api/client/utils/NpoApiImageUtilITest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
* @author Michiel Meeuwissen
1414
*/
1515
@Slf4j
16-
public class NpoApiImageUtilITest {
16+
class NpoApiImageUtilITest {
1717

1818
@SuppressWarnings("OptionalGetWithoutIsPresent")
1919
@Test
20-
public void getGetSize() {
20+
void getGetSize() {
2121

2222
NpoApiImageUtil util = new NpoApiImageUtil("https://images-test.poms.omroep.nl/");
2323
ConfigUtils.configuredInHome(util, "apiclient.properties");

client-extras/src/test/java/nl/vpro/api/client/utils/NpoApiPageUtilTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
@Disabled("This is an integration test")
2323
@Slf4j
24-
public class NpoApiPageUtilTest {
24+
class NpoApiPageUtilTest {
2525

2626
private static final String[] TEST_MIDS = {"AVRO_1656037", "AVRO_1656037", "POMS_VPRO_487567", "BLOE_234", "WO_VPRO_4993480"};
2727

@@ -30,7 +30,7 @@ public class NpoApiPageUtilTest {
3030
new NpoApiRateLimiter());
3131

3232
@Test
33-
public void testLoadMultiple() {
33+
void testLoadMultiple() {
3434
Page[] result = util.loadByMid(Arrays.asList("vpro", null), null, TEST_MIDS);
3535
System.out.println(Arrays.asList(result));
3636
System.out.println(util.getClients().getCounts());
@@ -39,7 +39,7 @@ public void testLoadMultiple() {
3939
}
4040

4141
@Test
42-
public void testSupplier() {
42+
void testSupplier() {
4343
List<Supplier<Optional<Page>>> result = new ArrayList<>();
4444
for (String m : TEST_MIDS) {
4545
result.add(util.supplyByMid(Arrays.asList("vpro", null), null, m));
@@ -57,7 +57,7 @@ public void testSupplier() {
5757

5858

5959
@Test
60-
public void iterate() throws IOException {
60+
void iterate() throws IOException {
6161
String profile = "vpro-predictions";
6262
File out = new File("/tmp/" + profile);
6363
final List<String> ids = new ArrayList<>();

0 commit comments

Comments
 (0)