Migrate to new HttpHeaders API
See gh-45487 Co-authored-by: Phillip Webb <phil.webb@broadcom.com>
This commit is contained in:
committed by
Phillip Webb
parent
6fceab2c90
commit
5ea0674bad
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -45,6 +45,7 @@ import org.springframework.mock.http.client.MockClientHttpResponse;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.entry;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.BDDMockito.then;
|
||||
@@ -168,7 +169,7 @@ class RestTemplateAutoConfigurationTests {
|
||||
given(requestFactory.createRequest(any(), any())).willReturn(request);
|
||||
RestTemplate restTemplate = builder.requestFactory(() -> requestFactory).build();
|
||||
restTemplate.getForEntity("http://localhost:8080/test", String.class);
|
||||
assertThat(request.getHeaders()).containsEntry("spring", Collections.singletonList("boot"));
|
||||
assertThat(request.getHeaders().headerSet()).contains(entry("spring", Collections.singletonList("boot")));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user