Skip to content

Commit e7f8a29

Browse files
chore(dependency update): update dependencies and migrate wiremock to latest version
1 parent abf4df6 commit e7f8a29

File tree

35 files changed

+425
-826
lines changed

35 files changed

+425
-826
lines changed

.mvn/wrapper/maven-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
1818
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

components/api/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@
5858
<artifactId>guava</artifactId>
5959
</dependency>
6060

61-
<dependency>
62-
<groupId>com.google.code.findbugs</groupId>
63-
<artifactId>annotations</artifactId>
64-
</dependency>
65-
6661
<dependency>
6762
<groupId>com.fasterxml.uuid</groupId>
6863
<artifactId>java-uuid-generator</artifactId>

components/client/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@
3737
<artifactId>styx-api</artifactId>
3838
</dependency>
3939

40-
<dependency>
41-
<groupId>com.google.code.findbugs</groupId>
42-
<artifactId>annotations</artifactId>
43-
</dependency>
44-
4540
<dependency>
4641
<groupId>io.dropwizard.metrics</groupId>
4742
<artifactId>metrics-json</artifactId>

components/client/src/main/java/com/hotels/styx/client/HttpClient.java

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2013-2021 Expedia Inc.
2+
Copyright (C) 2013-2024 Expedia Inc.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
2424

2525
/**
2626
* A Styx HTTP client interface.
27-
*
27+
* <p>
2828
* This interface offers a fluent interface to build and configure HTTP
2929
* request transactions from a client instance. The requests can be consumed
3030
* either aggregated {@link HttpResponse} or streaming {@link LiveHttpRequest}
@@ -33,29 +33,16 @@
3333
public interface HttpClient {
3434

3535
/**
36-
* Sends a HTTP request message using this client.
37-
*
38-
* @deprecated use {@link #send} instead.
39-
*
40-
* @param request a full HTTP request object
41-
* @return a future of full HTTP request object
42-
*/
43-
@Deprecated
44-
default CompletableFuture<HttpResponse> sendRequest(HttpRequest request) {
45-
return send(request);
46-
}
47-
48-
/**
49-
* Sends a HTTP request message using this client.
36+
* Sends an HTTP request message using this client.
5037
*
5138
* @param request a full HTTP request object
5239
* @return a future of full HTTP request object
5340
*/
5441
CompletableFuture<HttpResponse> send(HttpRequest request);
5542

5643
/**
57-
* A HTTP request transaction.
58-
*
44+
* An HTTP request transaction.
45+
* <p>
5946
* This interface allows client attributes and context to be customised
6047
* for each request without having to rely on configured default values
6148
* in the client.
@@ -80,7 +67,7 @@ interface Transaction {
8067

8168
/**
8269
* Converts the transaction object to streaming transaction.
83-
*
70+
* <p>
8471
* A call to {@code streaming()} converts this {@link Transaction} object to
8572
* a {@link StreamingTransaction}. This allows responses to be consumed
8673
* in streaming responses.
@@ -90,7 +77,7 @@ interface Transaction {
9077
StreamingTransaction streaming();
9178

9279
/**
93-
* Sends a HTTP request message using this client.
80+
* Sends an HTTP request message using this client.
9481
*
9582
* @param request a full HTTP request object
9683
* @return a future of full HTTP request object
@@ -100,7 +87,7 @@ interface Transaction {
10087

10188
/**
10289
* A streaming HTTP request transaction.
103-
*
90+
* <p>
10491
* This interface allows the response object to be consumed in a streaming
10592
* fashion instead of being aggregated into a HttpResponse.
10693
*/

components/client/src/test/integration/scala/com/hotels/styx/client/OriginSupport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2013-2022 Expedia Inc.
2+
Copyright (C) 2013-2024 Expedia Inc.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

components/client/src/test/unit/java/com/hotels/styx/client/netty/connectionpool/NettyConnectionFactoryTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2013-2021 Expedia Inc.
2+
Copyright (C) 2013-2024 Expedia Inc.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020
import com.hotels.styx.client.Connection;
2121
import com.hotels.styx.client.ConnectionSettings;
2222
import com.hotels.styx.support.server.FakeHttpServer;
23+
import com.hotels.styx.support.server.UrlMatchingStrategies;
2324
import io.netty.channel.Channel;
2425
import io.netty.channel.ChannelHandlerContext;
2526
import io.netty.channel.SimpleChannelInboundHandler;

components/proxy/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@
6262
<artifactId>guava</artifactId>
6363
</dependency>
6464

65-
<dependency>
66-
<groupId>com.google.code.findbugs</groupId>
67-
<artifactId>annotations</artifactId>
68-
</dependency>
69-
7065
<!--For logback.xml-->
7166
<dependency>
7267
<groupId>org.codehaus.janino</groupId>

components/proxy/src/test/java/com/hotels/styx/admin/handlers/ServiceProviderHandlerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2013-2021 Expedia Inc.
2+
Copyright (C) 2013-2024 Expedia Inc.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -17,13 +17,13 @@
1717

1818
import com.fasterxml.jackson.databind.JsonNode;
1919
import com.fasterxml.jackson.databind.ObjectMapper;
20+
import com.hotels.styx.StyxObjectRecord;
2021
import com.hotels.styx.api.HttpRequest;
2122
import com.hotels.styx.api.HttpResponse;
2223
import com.hotels.styx.api.extension.service.spi.StyxService;
2324
import com.hotels.styx.routing.config.StyxObjectDefinition;
2425
import com.hotels.styx.routing.db.StyxObjectStore;
25-
import com.hotels.styx.StyxObjectRecord;
26-
import org.apache.commons.lang.StringUtils;
26+
import org.apache.commons.lang3.StringUtils;
2727
import org.junit.jupiter.api.Test;
2828
import reactor.core.publisher.Mono;
2929

@@ -35,10 +35,10 @@
3535
import java.util.Optional;
3636
import java.util.stream.Collectors;
3737

38-
import static com.hotels.styx.support.Support.requestContext;
3938
import static com.hotels.styx.api.HttpResponseStatus.NOT_FOUND;
4039
import static com.hotels.styx.api.HttpResponseStatus.NO_CONTENT;
4140
import static com.hotels.styx.api.HttpResponseStatus.OK;
41+
import static com.hotels.styx.support.Support.requestContext;
4242
import static java.nio.charset.StandardCharsets.UTF_8;
4343
import static org.hamcrest.MatcherAssert.assertThat;
4444
import static org.hamcrest.Matchers.containsInAnyOrder;

components/proxy/src/test/java/com/hotels/styx/proxy/StyxProxyTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2013-2021 Expedia Inc.
2+
Copyright (C) 2013-2024 Expedia Inc.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -139,6 +139,6 @@ private HttpResponse get(String uri) {
139139
}
140140

141141
private HttpResponse execute(HttpRequest request) {
142-
return await(client.sendRequest(request));
142+
return await(client.send(request));
143143
}
144144
}

components/test-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</dependency>
6464

6565
<dependency>
66-
<groupId>com.github.tomakehurst</groupId>
66+
<groupId>org.wiremock</groupId>
6767
<artifactId>wiremock</artifactId>
6868
<scope>compile</scope>
6969
</dependency>

components/test-api/src/test/java/com/hotels/styx/testapi/StyxServerTest.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (C) 2013-2021 Expedia Inc.
2+
Copyright (C) 2013-2024 Expedia Inc.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -119,7 +119,7 @@ public void proxiesToOrigin() {
119119
.addRoute("/", originServer1.port())
120120
.start();
121121

122-
HttpResponse response = await(client.sendRequest(get(format("https://localhost:%d/", styxServer.proxyHttpPort())).build()));
122+
HttpResponse response = await(client.send(get(format("https://localhost:%d/", styxServer.proxyHttpPort())).build()));
123123

124124
assertThat(response.status(), is(OK));
125125
configureFor(originServer1.port());
@@ -133,7 +133,7 @@ public void startsProxyOnSpecifiedHttpPort() {
133133
.addRoute("/", originServer1.port())
134134
.start();
135135

136-
HttpResponse response = await(client.sendRequest(get(format("https://localhost:%d/", styxServer.proxyHttpPort())).build()));
136+
HttpResponse response = await(client.send(get(format("https://localhost:%d/", styxServer.proxyHttpPort())).build()));
137137

138138
assertThat(response.status(), is(OK));
139139
}
@@ -145,7 +145,7 @@ public void startsAdminOnSpecifiedHttpPort() {
145145
.addRoute("/", originServer1.port())
146146
.start();
147147

148-
HttpResponse response = await(client.sendRequest(get(format("https://localhost:%d/admin", styxServer.adminPort())).build()));
148+
HttpResponse response = await(client.send(get(format("https://localhost:%d/admin", styxServer.adminPort())).build()));
149149

150150
assertThat(response.status(), is(OK));
151151
}
@@ -161,7 +161,7 @@ public void startsProxyOnSpecifiedHttpsPort() {
161161
.tlsSettings(new TlsSettings.Builder().build())
162162
.build();
163163

164-
HttpResponse response = await(tlsClient.sendRequest(get(format("https://localhost:%d/", styxServer.proxyHttpsPort())).build()));
164+
HttpResponse response = await(tlsClient.send(get(format("https://localhost:%d/", styxServer.proxyHttpsPort())).build()));
165165

166166
assertThat(response.status(), is(OK));
167167
}
@@ -195,7 +195,7 @@ public void proxiesToOriginViaHttps() {
195195
.tlsSettings(new TlsSettings.Builder().build())
196196
.build();
197197

198-
HttpResponse response = await(tlsClient.sendRequest(get(format("https://localhost:%d/", styxServer.proxyHttpsPort())).build()));
198+
HttpResponse response = await(tlsClient.send(get(format("https://localhost:%d/", styxServer.proxyHttpsPort())).build()));
199199

200200
assertThat(response.status(), is(OK));
201201
configureFor(secureOriginServer.port());
@@ -212,7 +212,7 @@ public void proxiesToOriginViaHttpsWithRequestOriginallyHttp() {
212212
.addRoute("/", backendService)
213213
.start();
214214

215-
HttpResponse response = await(client.sendRequest(get(format("http://localhost:%d/", styxServer.proxyHttpPort())).build()));
215+
HttpResponse response = await(client.send(get(format("http://localhost:%d/", styxServer.proxyHttpPort())).build()));
216216

217217
assertThat(response.status(), is(OK));
218218
configureFor(secureOriginServer.port());
@@ -226,12 +226,12 @@ public void routesCorrectly() {
226226
.addRoute("/o2/", originServer2.port())
227227
.start();
228228

229-
HttpResponse response1 = await(client.sendRequest(get(format("http://localhost:%d/foo", styxServer.proxyHttpPort())).build()));
229+
HttpResponse response1 = await(client.send(get(format("http://localhost:%d/foo", styxServer.proxyHttpPort())).build()));
230230

231231
assertThat(response1.status(), is(OK));
232232
assertThat(response1.header("origin"), isValue("first"));
233233

234-
HttpResponse response2 = await(client.sendRequest(get(format("http://localhost:%d/o2/foo", styxServer.proxyHttpPort())).build()));
234+
HttpResponse response2 = await(client.send(get(format("http://localhost:%d/o2/foo", styxServer.proxyHttpPort())).build()));
235235
assertThat(response2.status(), is(OK));
236236
assertThat(response2.header("origin"), isValue("second"));
237237

@@ -255,7 +255,7 @@ public void executesPluginsWhenProxying() {
255255
.addPluginFactory("response-decorator", pluginFactory, null)
256256
.start();
257257

258-
HttpResponse response = await(client.sendRequest(get(format("http://localhost:%d/foo", styxServer.proxyHttpPort())).build()));
258+
HttpResponse response = await(client.send(get(format("http://localhost:%d/foo", styxServer.proxyHttpPort())).build()));
259259
assertThat(response.status(), is(OK));
260260
assertThat(response.header("origin"), isValue("first"));
261261
assertThat(response.header("plugin-executed"), isValue("yes"));
@@ -344,7 +344,7 @@ private Plugin mockPlugin(Map<String, HttpHandler> adminInterfaceHandlers) {
344344

345345
private HttpResponse doAdminRequest(String path) {
346346
String url = format("%s://localhost:%s%s", "http", styxServer.adminPort(), startWithSlash(path));
347-
return await(client.sendRequest(get(url).build()));
347+
return await(client.send(get(url).build()));
348348
}
349349

350350
@Test
@@ -368,11 +368,11 @@ public void canConfigureWithStyxOrigins() {
368368
.addRoute("/o2/", origin(originServer2.port()))
369369
.start();
370370

371-
HttpResponse response1 = await(client.sendRequest(get(format("http://localhost:%d/foo", styxServer.proxyHttpPort())).build()));
371+
HttpResponse response1 = await(client.send(get(format("http://localhost:%d/foo", styxServer.proxyHttpPort())).build()));
372372
assertThat(response1.status(), is(OK));
373373
assertThat(response1.header("origin"), isValue("first"));
374374

375-
HttpResponse response2 = await(client.sendRequest(get(format("http://localhost:%d/o2/foo", styxServer.proxyHttpPort())).build()));
375+
HttpResponse response2 = await(client.send(get(format("http://localhost:%d/o2/foo", styxServer.proxyHttpPort())).build()));
376376
assertThat(response2.status(), is(OK));
377377
assertThat(response2.header("origin"), isValue("second"));
378378

@@ -389,11 +389,11 @@ public void canConfigureWithBackendService() {
389389
.addRoute("/o2/", new BackendService().addOrigin(originServer2.port()))
390390
.start();
391391

392-
HttpResponse response1 = await(client.sendRequest(get(format("http://localhost:%d/foo", styxServer.proxyHttpPort())).build()));
392+
HttpResponse response1 = await(client.send(get(format("http://localhost:%d/foo", styxServer.proxyHttpPort())).build()));
393393
assertThat(response1.status(), is(OK));
394394
assertThat(response1.header("origin"), isValue("first"));
395395

396-
HttpResponse response2 = await(client.sendRequest(get(format("http://localhost:%d/o2/foo", styxServer.proxyHttpPort())).build()));
396+
HttpResponse response2 = await(client.send(get(format("http://localhost:%d/o2/foo", styxServer.proxyHttpPort())).build()));
397397
assertThat(response2.status(), is(OK));
398398
assertThat(response2.header("origin"), isValue("second"));
399399

demo/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<artifactId>kotlin-stdlib</artifactId>
2626
</dependency>
2727
<dependency>
28-
<groupId>com.github.tomakehurst</groupId>
28+
<groupId>org.wiremock</groupId>
2929
<artifactId>wiremock</artifactId>
3030
</dependency>
3131

0 commit comments

Comments
 (0)