Remove deprecated web APIs

See gh-33809
This commit is contained in:
rstoyanchev
2025-01-15 13:02:20 +00:00
parent 83c020eea5
commit 4920086225
38 changed files with 65 additions and 1305 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.
@@ -17,7 +17,6 @@
package org.springframework.http.codec.support;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@@ -413,19 +412,6 @@ class CodecConfigurerTests {
assertThat(encoders).doesNotContain(jacksonEncoder, jaxb2Encoder, protoEncoder);
}
@SuppressWarnings("deprecation")
@Test
void withDefaultCodecConfig() {
AtomicBoolean callbackCalled = new AtomicBoolean();
this.configurer.defaultCodecs().enableLoggingRequestDetails(true);
this.configurer.customCodecs().withDefaultCodecConfig(config -> {
assertThat(config.isEnableLoggingRequestDetails()).isTrue();
callbackCalled.compareAndSet(false, true);
});
this.configurer.getReaders();
assertThat(callbackCalled).isTrue();
}
private Decoder<?> getNextDecoder(List<HttpMessageReader<?>> readers) {
HttpMessageReader<?> reader = readers.get(this.index.getAndIncrement());
assertThat(reader.getClass()).isEqualTo(DecoderHttpMessageReader.class);

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.
@@ -89,16 +89,14 @@ class CorsUtilsTests {
}
@Test // SPR-16362
@SuppressWarnings("deprecation")
public void isSameOriginWithDifferentSchemes() {
MockServerHttpRequest request = MockServerHttpRequest
.get("http://mydomain1.example")
.header(HttpHeaders.ORIGIN, "https://mydomain1.example")
.build();
assertThat(CorsUtils.isSameOrigin(request)).isFalse();
assertThat(CorsUtils.isCorsRequest(request)).isTrue();
}
@SuppressWarnings("deprecation")
private void testWithXForwardedHeaders(String serverName, int port,
String forwardedProto, String forwardedHost, int forwardedPort, String originHeader) {
@@ -119,10 +117,9 @@ class CorsUtilsTests {
}
ServerHttpRequest request = adaptFromForwardedHeaders(builder);
assertThat(CorsUtils.isSameOrigin(request)).isTrue();
assertThat(CorsUtils.isCorsRequest(request)).isFalse();
}
@SuppressWarnings("deprecation")
private void testWithForwardedHeader(String serverName, int port,
String forwardedHeader, String originHeader) {
@@ -136,7 +133,7 @@ class CorsUtilsTests {
.header(HttpHeaders.ORIGIN, originHeader);
ServerHttpRequest request = adaptFromForwardedHeaders(builder);
assertThat(CorsUtils.isSameOrigin(request)).isTrue();
assertThat(CorsUtils.isCorsRequest(request)).isFalse();
}
// SPR-16668