Skip to content

Commit a11ad14

Browse files
committed
#28 - Remove deprecated methods for verbs get(), put() etc ... need to use GET() PUT() etc
1 parent b7c3628 commit a11ad14

File tree

8 files changed

+8
-73
lines changed

8 files changed

+8
-73
lines changed

http-client/client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<groupId>io.avaje</groupId>
1111
<artifactId>avaje-http-client</artifactId>
12-
<version>1.8.2-SNAPSHOT</version>
12+
<version>1.9-SNAPSHOT</version>
1313

1414
<scm>
1515
<developerConnection>scm:git:[email protected]:avaje/avaje-http-client.git</developerConnection>

http-client/client/src/main/java/io/avaje/http/client/HttpClientRequest.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -307,46 +307,6 @@ public interface HttpClientRequest {
307307
*/
308308
HttpClientRequest body(HttpRequest.BodyPublisher body);
309309

310-
/**
311-
* Deprecated migrate to GET().
312-
*/
313-
@Deprecated
314-
default HttpClientResponse get() {
315-
return GET();
316-
}
317-
318-
/**
319-
* Deprecated migrate to POST().
320-
*/
321-
@Deprecated
322-
default HttpClientResponse post() {
323-
return POST();
324-
}
325-
326-
/**
327-
* Deprecated migrate to PUT().
328-
*/
329-
@Deprecated
330-
default HttpClientResponse put() {
331-
return PUT();
332-
}
333-
334-
/**
335-
* Deprecated migrate to PATCH().
336-
*/
337-
@Deprecated
338-
default HttpClientResponse patch() {
339-
return PATCH();
340-
}
341-
342-
/**
343-
* Deprecated migrate to DELETE().
344-
*/
345-
@Deprecated
346-
default HttpClientResponse delete() {
347-
return DELETE();
348-
}
349-
350310
/**
351311
* Execute the request as a GET.
352312
*/

http-client/client/src/main/java/io/avaje/http/client/HttpClientResponse.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,4 @@ public interface HttpClientResponse {
146146
*/
147147
<T> HttpResponse<T> withHandler(HttpResponse.BodyHandler<T> responseHandler);
148148

149-
/**
150-
* Deprecated migrate to {@link #withHandler(HttpResponse.BodyHandler)}
151-
*/
152-
@Deprecated
153-
default <T> HttpResponse<T> withResponseHandler(HttpResponse.BodyHandler<T> responseHandler) {
154-
return withHandler(responseHandler);
155-
}
156-
157149
}

http-client/client/src/main/java/io/avaje/http/client/HttpException.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,11 @@ public int statusCode() {
124124
return statusCode;
125125
}
126126

127-
/**
128-
* Deprecated migrate to statusCode()
129-
*/
130-
@Deprecated
131-
public int getStatusCode() {
132-
return statusCode();
133-
}
134-
135127
/**
136128
* Return the underlying HttpResponse.
137129
*/
138130
public HttpResponse<?> httpResponse() {
139131
return httpResponse;
140132
}
141133

142-
/**
143-
* Deprecated migrate to httpResponse().
144-
*/
145-
@Deprecated
146-
public HttpResponse<?> getHttpResponse() {
147-
return httpResponse();
148-
}
149-
150134
}

http-client/client/src/test/java/io/avaje/http/client/HelloControllerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ void async_whenComplete_throwingHttpException() {
722722

723723
final HttpException httpException = (HttpException) throwable.getCause();
724724
causeRef.set(httpException);
725-
assertThat(httpException.getStatusCode()).isEqualTo(422);
725+
assertThat(httpException.statusCode()).isEqualTo(422);
726726

727727
// convert json error response body to a bean
728728
final ErrorResponse errorResponse = httpException.bean(ErrorResponse.class);
@@ -903,7 +903,7 @@ void postForm_asVoid_invokesValidation_expect_badRequest_extractError() {
903903
} catch (HttpException e) {
904904
assertEquals(422, e.statusCode());
905905

906-
final HttpResponse<?> httpResponse = e.getHttpResponse();
906+
final HttpResponse<?> httpResponse = e.httpResponse();
907907
assertNotNull(httpResponse);
908908
assertEquals(422, httpResponse.statusCode());
909909

http-client/test/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
<dependency>
1717
<groupId>io.avaje</groupId>
1818
<artifactId>avaje-http-client</artifactId>
19-
<version>1.3</version>
19+
<version>1.9-SNAPSHOT</version>
2020
</dependency>
2121

2222
<dependency>
2323
<groupId>io.avaje</groupId>
2424
<artifactId>avaje-http-client-gson</artifactId>
25-
<version>1.3</version>
25+
<version>1.8</version>
2626
</dependency>
2727

2828
<dependency>
2929
<groupId>io.avaje</groupId>
3030
<artifactId>avaje-http-api</artifactId>
31-
<version>1.2</version>
31+
<version>1.7</version>
3232
</dependency>
3333

3434
<dependency>

http-client/test/src/main/java/example/github/SimpleHttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public List<Repo> listRepos(String user, String other) throws HttpException {
3737
return context.request()
3838
.path("users").path(user).path("repos")
3939
.queryParam("other", other)
40-
.get().list(Repo.class);
40+
.GET().list(Repo.class);
4141
}
4242

4343
}

http-client/test/src/test/java/example/github/GithubTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.fasterxml.jackson.databind.ObjectMapper;
55
import com.google.gson.Gson;
66
import io.avaje.http.client.BodyAdapter;
7-
import io.avaje.http.client.HttpApi;
87
import io.avaje.http.client.HttpClientContext;
98
import io.avaje.http.client.JacksonBodyAdapter;
109
import io.avaje.http.client.RequestLogger;
@@ -34,7 +33,7 @@ private void assertListRepos(BodyAdapter bodyAdapter) {
3433
.withRequestListener(new RequestLogger())
3534
.build();
3635

37-
final Simple simple = HttpApi.provide(Simple.class, clientContext);
36+
final Simple simple = clientContext.create(Simple.class);
3837

3938
final List<Repo> repos = simple.listRepos("rbygrave", "junk");
4039
assertThat(repos).isNotEmpty();

0 commit comments

Comments
 (0)