Refactoring in ApiVersionInserter
Refine naming of static factory methods, and update them to be shortcuts for instance creation. See gh-34919
This commit is contained in:
@@ -41,19 +41,19 @@ public class ApiVersionTests {
|
||||
|
||||
@Test
|
||||
void header() {
|
||||
Map<String, String> result = performRequest(ApiVersionInserter.fromHeader("X-API-Version").build());
|
||||
Map<String, String> result = performRequest(ApiVersionInserter.useHeader("X-API-Version"));
|
||||
assertThat(result.get(HEADER_NAME)).isEqualTo("1.2");
|
||||
}
|
||||
|
||||
@Test
|
||||
void queryParam() {
|
||||
Map<String, String> result = performRequest(ApiVersionInserter.fromQueryParam("api-version").build());
|
||||
Map<String, String> result = performRequest(ApiVersionInserter.useQueryParam("api-version"));
|
||||
assertThat(result.get("query")).isEqualTo("api-version=1.2");
|
||||
}
|
||||
|
||||
@Test
|
||||
void pathSegment() {
|
||||
Map<String, String> result = performRequest(ApiVersionInserter.fromPathSegment(0).build());
|
||||
Map<String, String> result = performRequest(ApiVersionInserter.usePathSegment(0));
|
||||
assertThat(result.get("path")).isEqualTo("/1.2/path");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user