Make SslInfo nullable

This allows autowiring a MockServerSpec in test class and using a different
identity or none at all with each test.

Polishing in MockServerSpecTests.

See gh-35042
This commit is contained in:
rstoyanchev
2025-07-03 11:03:46 +01:00
parent 6091453feb
commit 1b30b469c4
3 changed files with 45 additions and 28 deletions
@@ -71,8 +71,8 @@ abstract class AbstractMockServerSpec<B extends WebTestClient.MockServerSpec<B>>
}
@Override
public <T extends B> T sslInfo(SslInfo sslInfo) {
this.sslInfo = sslInfo;
public <T extends B> T sslInfo(@Nullable SslInfo info) {
this.sslInfo = info;
return self();
}
@@ -277,13 +277,13 @@ public interface WebTestClient {
<T extends B> T webSessionManager(WebSessionManager sessionManager);
/**
* Provide SSL session information and certificates for the mock server.
* @param sslInfo the {@link SslInfo} to use
* Set or reset SSL session information to assign to mock server requests.
* @param info the {@link SslInfo} to use
* @since 7.0
* @see SslInfo#from(String)
* @see SslInfo#from(String, java.security.cert.X509Certificate...)
*/
<T extends B> T sslInfo(SslInfo sslInfo);
<T extends B> T sslInfo(@Nullable SslInfo info);
/**
* Shortcut for pre-packaged customizations to the mock server setup.