Polishing in client adapter tests

This commit is contained in:
rstoyanchev
2025-03-26 11:47:51 +01:00
parent 5c93bb38c4
commit 483abd96a4
2 changed files with 26 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-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.
@@ -90,8 +90,7 @@ class WebClientAdapterTests {
@Test
void greeting() {
prepareResponse(response ->
response.setHeader("Content-Type", "text/plain").setBody("Hello Spring!"));
prepareResponse(response -> response.setHeader("Content-Type", "text/plain").setBody("Hello Spring!"));
StepVerifier.create(initService().getGreeting())
.expectNext("Hello Spring!")
@@ -111,8 +110,7 @@ class WebClientAdapterTests {
})
.build();
prepareResponse(response ->
response.setHeader("Content-Type", "text/plain").setBody("Hello Spring!"));
prepareResponse(response -> response.setHeader("Content-Type", "text/plain").setBody("Hello Spring!"));
StepVerifier.create(initService(webClient).getGreetingWithAttribute("myAttributeValue"))
.expectNext("Hello Spring!")
@@ -154,8 +152,8 @@ class WebClientAdapterTests {
prepareResponse(response -> response.setResponseCode(201));
String fileName = "testFileName";
String originalFileName = "originalTestFileName";
MultipartFile file = new MockMultipartFile(fileName, originalFileName,
MediaType.APPLICATION_JSON_VALUE, "test".getBytes());
MultipartFile file = new MockMultipartFile(
fileName, originalFileName, MediaType.APPLICATION_JSON_VALUE, "test".getBytes());
initService().postMultipart(file, "test2");
@@ -255,12 +253,11 @@ class WebClientAdapterTests {
String getWithUriBuilderFactory(UriBuilderFactory uriBuilderFactory);
@GetExchange("/greeting/{id}")
String getWithUriBuilderFactory(UriBuilderFactory uriBuilderFactory,
@PathVariable String id, @RequestParam String param);
String getWithUriBuilderFactory(
UriBuilderFactory uriBuilderFactory, @PathVariable String id, @RequestParam String param);
@GetExchange("/greeting")
String getWithIgnoredUriBuilderFactory(URI uri, UriBuilderFactory uriBuilderFactory);
}
}