Skip to content

Commit

Permalink
Adjust to changes in commons.
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaMaciaszek committed Sep 5, 2022
1 parent 5a21e22 commit 666a59d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -33,6 +33,7 @@
import org.springframework.cloud.client.loadbalancer.ResponseData;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatusCode;

/**
* @author Olga Maciaszek-Sharma
Expand Down Expand Up @@ -72,7 +73,8 @@ static Response executeWithLoadBalancerLifecycleProcessing(Client feignClient, R
static ResponseData buildResponseData(Response response) {
HttpHeaders responseHeaders = new HttpHeaders();
response.headers().forEach((key, value) -> responseHeaders.put(key, new ArrayList<>(value)));
return new ResponseData(response.status(), responseHeaders, null, buildRequestData(response.request()));
return new ResponseData(HttpStatusCode.valueOf(response.status()), responseHeaders, null,
buildRequestData(response.request()));
}

static RequestData buildRequestData(Request request) {
Expand Down
Expand Up @@ -179,7 +179,7 @@ void shouldExecuteLoadBalancerLifecycleCallbacks() throws IOException {
.contains(callbackTestHint);
assertThat(anotherLifecycleLogRequests)
.extracting(completionContext -> completionContext.getClientResponse().getHttpStatus())
.contains(HttpStatus.OK.value());
.contains(HttpStatus.OK);
}

private String read(Response response) throws IOException {
Expand Down
Expand Up @@ -244,7 +244,7 @@ void shouldExecuteLoadBalancerLifecycleCallbacks() throws IOException {
.contains(callbackTestHint);
assertThat(anotherLifecycleLogRequests)
.extracting(completionContext -> completionContext.getClientResponse().getHttpStatus())
.contains(HttpStatus.OK.value());
.contains(HttpStatus.OK);
}

private Request testRequest() {
Expand Down

0 comments on commit 666a59d

Please sign in to comment.