Remove deprecated code

See gh-24806
pull/24851/head
Stephane Nicoll 4 years ago
parent a18f01addf
commit 2c2c160579

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -93,17 +93,6 @@ public final class MeterValue {
return new MeterValue(DurationStyle.detectAndParse(value));
}
/**
* Return a new {@link MeterValue} instance for the given long value.
* @param value the source value
* @return a {@link MeterValue} instance
* @deprecated as of 2.3.0 in favor of {@link #valueOf(double)}
*/
@Deprecated
public static MeterValue valueOf(long value) {
return new MeterValue(value);
}
/**
* Return a new {@link MeterValue} instance for the given double value.
* @param value the source value

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -20,7 +20,6 @@ import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
/**
@ -262,12 +261,6 @@ public class MetricsProperties {
return this.percentiles;
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "management.metrics.distribution.slo")
public Map<String, ServiceLevelObjectiveBoundary[]> getSla() {
return this.slo;
}
public Map<String, ServiceLevelObjectiveBoundary[]> getSlo() {
return this.slo;
}

@ -1,72 +0,0 @@
/*
* Copyright 2012-2020 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.metrics;
import java.time.Duration;
import io.micrometer.core.instrument.Meter;
/**
* A boundary for a service-level agreement (SLA) for use when configuring Micrometer. Can
* be specified as either a {@link Long} (applicable to timers and distribution summaries)
* or a {@link Duration} (applicable to only timers).
*
* @author Phillip Webb
* @since 2.0.0
* @deprecated as of 2.3.0 in favor of {@link ServiceLevelObjectiveBoundary}
*/
@Deprecated
public final class ServiceLevelAgreementBoundary {
private final MeterValue value;
ServiceLevelAgreementBoundary(MeterValue value) {
this.value = value;
}
/**
* Return the underlying value of the SLA in form suitable to apply to the given meter
* type.
* @param meterType the meter type
* @return the value or {@code null} if the value cannot be applied
*/
public Long getValue(Meter.Type meterType) {
Double value = this.value.getValue(meterType);
return (value != null) ? value.longValue() : null;
}
/**
* Return a new {@link ServiceLevelAgreementBoundary} instance for the given long
* value.
* @param value the source value
* @return a {@link ServiceLevelAgreementBoundary} instance
*/
public static ServiceLevelAgreementBoundary valueOf(long value) {
return new ServiceLevelAgreementBoundary(MeterValue.valueOf(value));
}
/**
* Return a new {@link ServiceLevelAgreementBoundary} instance for the given String
* value.
* @param value the source value
* @return a {@link ServiceLevelAgreementBoundary} instance
*/
public static ServiceLevelAgreementBoundary valueOf(String value) {
return new ServiceLevelAgreementBoundary(MeterValue.valueOf(value));
}
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -203,15 +203,6 @@ class PropertiesMeterFilterTests {
.containsExactly(1, 1.5, 2);
}
@Test
@Deprecated
void configureWhenHasDeprecatedSlaShouldSetSlaToValue() {
PropertiesMeterFilter filter = new PropertiesMeterFilter(
createProperties("distribution.sla.spring.boot=1,2,3"));
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT)
.getServiceLevelObjectiveBoundaries()).containsExactly(1000000, 2000000, 3000000);
}
@Test
void configureWhenHasSloShouldSetSloToValue() {
PropertiesMeterFilter filter = new PropertiesMeterFilter(

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -128,13 +128,12 @@ class ManagementErrorEndpointTests {
}
@Test
void errorResponseWithDefaultErrorAttributesSubclassUsingDeprecatedApiAndDelegation() {
void errorResponseWithDefaultErrorAttributesSubclassUsingDelegation() {
ErrorAttributes attributes = new DefaultErrorAttributes() {
@Override
@SuppressWarnings("deprecation")
public Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
Map<String, Object> response = super.getErrorAttributes(webRequest, includeStackTrace);
public Map<String, Object> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) {
Map<String, Object> response = super.getErrorAttributes(webRequest, options);
response.put("error", "custom error");
response.put("custom", "value");
response.remove("path");
@ -151,7 +150,7 @@ class ManagementErrorEndpointTests {
}
@Test
void errorResponseWithDefaultErrorAttributesSubclassUsingDeprecatedApiWithoutDelegation() {
void errorResponseWithDefaultErrorAttributesSubclassWithoutDelegation() {
ErrorAttributes attributes = new DefaultErrorAttributes() {
@Override

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -104,22 +104,6 @@ public class CachingOperationInvoker implements OperationInvoker {
return new CachedResponse(response, accessTime);
}
/**
* Apply caching configuration when appropriate to the given invoker.
* @param invoker the invoker to wrap
* @param timeToLive the maximum time in milliseconds that a response can be cached
* @return a caching version of the invoker or the original instance if caching is not
* required
* @deprecated as of 2.3.0 to make it package-private in 2.4
*/
@Deprecated
public static OperationInvoker apply(OperationInvoker invoker, long timeToLive) {
if (timeToLive > 0) {
return new CachingOperationInvoker(invoker, timeToLive);
}
return invoker;
}
/**
* A cached response that encapsulates the response itself and the time at which it
* was created.

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -94,30 +94,6 @@ public final class WebClientExchangeTags {
return CLIENT_ERROR;
}
/**
* Creates a {@code status} {@code Tag} derived from the
* {@link ClientResponse#statusCode()} of the given {@code response}.
* @param response the response
* @return the status tag
* @deprecated since 2.3.0 in favor of {@link #status(ClientResponse, Throwable)}
*/
@Deprecated
public static Tag status(ClientResponse response) {
return Tag.of("status", String.valueOf(response.rawStatusCode()));
}
/**
* Creates a {@code status} {@code Tag} derived from the exception thrown by the
* client.
* @param throwable the exception
* @return the status tag
* @deprecated since 2.3.0 in favor of {@link #status(ClientResponse, Throwable)}
*/
@Deprecated
public static Tag status(Throwable throwable) {
return (throwable instanceof IOException) ? IO_ERROR : CLIENT_ERROR;
}
/**
* Create a {@code clientName} {@code Tag} derived from the
* {@link java.net.URI#getHost host} of the {@link ClientRequest#url() URL} of the

@ -1,49 +0,0 @@
/*
* Copyright 2012-2020 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.batch;
import org.springframework.batch.core.explore.JobExplorer;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.boot.ApplicationRunner;
/**
* {@link ApplicationRunner} to {@link JobLauncher launch} Spring Batch jobs. Runs all
* jobs in the surrounding context by default. Can also be used to launch a specific job
* by providing a jobName.
*
* @author Dave Syer
* @author Jean-Pierre Bergamin
* @author Mahmoud Ben Hassine
* @since 1.0.0
* @deprecated since 2.3.0 in favor of {@link JobLauncherApplicationRunner}
*/
@Deprecated
public class JobLauncherCommandLineRunner extends JobLauncherApplicationRunner {
/**
* Create a new {@link JobLauncherCommandLineRunner}.
* @param jobLauncher to launch jobs
* @param jobExplorer to check the job repository for previous executions
* @param jobRepository to check if a job instance exists with the given parameters
* when running a job
*/
public JobLauncherCommandLineRunner(JobLauncher jobLauncher, JobExplorer jobExplorer, JobRepository jobRepository) {
super(jobLauncher, jobExplorer, jobRepository);
}
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -39,20 +39,16 @@ import org.springframework.util.ObjectUtils;
* Couchbase cache configuration.
*
* @author Stephane Nicoll
* @since 1.4.0
* @deprecated since 2.3.3 as this class is not intended for public use. It will be made
* package-private in a future release
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Cluster.class, CouchbaseClientFactory.class, CouchbaseCacheManager.class })
@ConditionalOnMissingBean(CacheManager.class)
@ConditionalOnSingleCandidate(CouchbaseClientFactory.class)
@Conditional(CacheCondition.class)
@Deprecated
public class CouchbaseCacheConfiguration {
class CouchbaseCacheConfiguration {
@Bean
public CouchbaseCacheManager cacheManager(CacheProperties cacheProperties, CacheManagerCustomizers customizers,
CouchbaseCacheManager cacheManager(CacheProperties cacheProperties, CacheManagerCustomizers customizers,
ObjectProvider<CouchbaseCacheManagerBuilderCustomizer> couchbaseCacheManagerBuilderCustomizers,
CouchbaseClientFactory clientFactory) {
List<String> cacheNames = cacheProperties.getCacheNames();

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -24,7 +24,6 @@ import java.util.List;
import com.datastax.oss.driver.api.core.DefaultConsistencyLevel;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
/**
* Configuration properties for Cassandra.
@ -126,17 +125,6 @@ public class CassandraProperties {
this.sessionName = sessionName;
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "spring.data.cassandra.session-name")
public String getClusterName() {
return getSessionName();
}
@Deprecated
public void setClusterName(String clusterName) {
setSessionName(clusterName);
}
public List<String> getContactPoints() {
return this.contactPoints;
}
@ -181,61 +169,6 @@ public class CassandraProperties {
this.compression = compression;
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "spring.data.cassandra.request.consistency")
public DefaultConsistencyLevel getConsistencyLevel() {
return getRequest().getConsistency();
}
@Deprecated
public void setConsistencyLevel(DefaultConsistencyLevel consistency) {
getRequest().setConsistency(consistency);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "spring.data.cassandra.request.serial-consistency")
public DefaultConsistencyLevel getSerialConsistencyLevel() {
return getRequest().getSerialConsistency();
}
@Deprecated
public void setSerialConsistencyLevel(DefaultConsistencyLevel serialConsistency) {
getRequest().setSerialConsistency(serialConsistency);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "spring.data.cassandra.request.page-size")
public int getFetchSize() {
return getRequest().getPageSize();
}
@Deprecated
public void setFetchSize(int fetchSize) {
getRequest().setPageSize(fetchSize);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "spring.data.cassandra.connection.init-query-timeout")
public Duration getConnectTimeout() {
return getConnection().getInitQueryTimeout();
}
@Deprecated
public void setConnectTimeout(Duration connectTimeout) {
getConnection().setInitQueryTimeout(connectTimeout);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "spring.data.cassandra.request.timeout")
public Duration getReadTimeout() {
return getRequest().getTimeout();
}
@Deprecated
public void setReadTimeout(Duration readTimeout) {
getRequest().setTimeout(readTimeout);
}
public boolean isSsl() {
return this.ssl;
}

@ -1,36 +0,0 @@
/*
* Copyright 2012-2020 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.elasticsearch.rest;
import org.elasticsearch.client.RestClientBuilder;
/**
* Callback interface that can be implemented by beans wishing to further customize the
* {@link org.elasticsearch.client.RestClient} via a {@link RestClientBuilder} whilst
* retaining default auto-configuration.
*
* @author Brian Clozel
* @since 2.1.0
* @deprecated as of 2.3.1 in favor of
* {@link org.springframework.boot.autoconfigure.elasticsearch.RestClientBuilderCustomizer}
*/
@FunctionalInterface
@Deprecated
public interface RestClientBuilderCustomizer
extends org.springframework.boot.autoconfigure.elasticsearch.RestClientBuilderCustomizer {
}

@ -1,21 +0,0 @@
/*
* Copyright 2012-2020 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Deprecated auto-configuration for Elasticsearch client, superseded by classes in
* {@code org.springframework.boot.autoconfigure.elasticsearch}.
*/
package org.springframework.boot.autoconfigure.elasticsearch.rest;

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -21,8 +21,6 @@ import java.util.List;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import org.springframework.core.env.Environment;
/**
* A factory for a blocking {@link MongoClient}.
*
@ -39,30 +37,6 @@ import org.springframework.core.env.Environment;
*/
public class MongoClientFactory extends MongoClientFactorySupport<MongoClient> {
/**
* Construct a factory for creating a blocking {@link MongoClient}.
* @param properties configuration properties
* @param environment a Spring {@link Environment} containing configuration properties
* @deprecated since 2.3.0 in favor of {@link #MongoClientFactory(List)}
*/
@Deprecated
public MongoClientFactory(MongoProperties properties, Environment environment) {
this(null);
}
/**
* Construct a factory for creating a blocking {@link MongoClient}.
* @param properties configuration properties
* @param environment a Spring {@link Environment} containing configuration properties
* @param builderCustomizers a list of configuration settings customizers
* @deprecated since 2.4.0 in favor of {@link #MongoClientFactory(List)}
*/
@Deprecated
public MongoClientFactory(MongoProperties properties, Environment environment,
List<MongoClientSettingsBuilderCustomizer> builderCustomizers) {
this(builderCustomizers);
}
/**
* Construct a factory for creating a blocking {@link MongoClient}.
* @param builderCustomizers a list of configuration settings customizers

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -24,8 +24,6 @@ import com.mongodb.MongoClientSettings;
import com.mongodb.MongoClientSettings.Builder;
import com.mongodb.MongoDriverInformation;
import org.springframework.core.env.Environment;
/**
* Base class for setup that is common to MongoDB client factories.
*
@ -40,13 +38,6 @@ public abstract class MongoClientFactorySupport<T> {
private final BiFunction<MongoClientSettings, MongoDriverInformation, T> clientCreator;
@Deprecated
protected MongoClientFactorySupport(MongoProperties properties, Environment environment,
List<MongoClientSettingsBuilderCustomizer> builderCustomizers,
BiFunction<MongoClientSettings, MongoDriverInformation, T> clientCreator) {
this(builderCustomizers, clientCreator);
}
protected MongoClientFactorySupport(List<MongoClientSettingsBuilderCustomizer> builderCustomizers,
BiFunction<MongoClientSettings, MongoDriverInformation, T> clientCreator) {
this.builderCustomizers = (builderCustomizers != null) ? builderCustomizers : Collections.emptyList();

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -21,8 +21,6 @@ import java.util.List;
import com.mongodb.reactivestreams.client.MongoClient;
import com.mongodb.reactivestreams.client.MongoClients;
import org.springframework.core.env.Environment;
/**
* A factory for a reactive {@link MongoClient}.
*
@ -33,19 +31,6 @@ import org.springframework.core.env.Environment;
*/
public class ReactiveMongoClientFactory extends MongoClientFactorySupport<MongoClient> {
/**
* Construct a factory for creating a {@link MongoClient}.
* @param properties configuration properties
* @param environment a Spring {@link Environment} containing configuration properties
* @param builderCustomizers a list of configuration settings customizers
* @deprecated since 2.4.0 in favor of {@link #ReactiveMongoClientFactory(List)}
*/
@Deprecated
public ReactiveMongoClientFactory(MongoProperties properties, Environment environment,
List<MongoClientSettingsBuilderCustomizer> builderCustomizers) {
super(properties, environment, builderCustomizers, MongoClients::create);
}
/**
* Construct a factory for creating a {@link MongoClient}.
* @param builderCustomizers a list of configuration settings customizers

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -22,7 +22,6 @@ import java.util.List;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.core.io.Resource;
import org.springframework.security.saml2.provider.service.registration.Saml2MessageBinding;
@ -257,17 +256,6 @@ public class Saml2RelyingPartyProperties {
this.metadataUri = metadataUri;
}
@Deprecated
@DeprecatedConfigurationProperty(reason = "moved to 'singlesignon.url'")
public String getSsoUrl() {
return this.singlesignon.getUrl();
}
@Deprecated
public void setSsoUrl(String ssoUrl) {
this.singlesignon.setUrl(ssoUrl);
}
public Singlesignon getSinglesignon() {
return this.singlesignon;
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -101,6 +101,28 @@ public class ErrorProperties {
return this.whitelabel;
}
/**
* Include Stacktrace attribute options.
*/
public enum IncludeStacktrace {
/**
* Never add stacktrace information.
*/
NEVER,
/**
* Always add stacktrace information.
*/
ALWAYS,
/**
* Add error attribute when the appropriate request parameter is "true".
*/
ON_PARAM
}
/**
* Include error attributes options.
*/

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -31,7 +31,6 @@ import java.util.Map;
import io.undertow.UndertowOptions;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.boot.convert.DurationUnit;
import org.springframework.boot.web.server.Compression;
@ -411,28 +410,6 @@ public class ServerProperties {
*/
private final Remoteip remoteip = new Remoteip();
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.tomcat.threads.max")
public int getMaxThreads() {
return getThreads().getMax();
}
@Deprecated
public void setMaxThreads(int maxThreads) {
getThreads().setMax(maxThreads);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.tomcat.threads.min-spare")
public int getMinSpareThreads() {
return getThreads().getMinSpare();
}
@Deprecated
public void setMinSpareThreads(int minSpareThreads) {
getThreads().setMinSpare(minSpareThreads);
}
public DataSize getMaxHttpFormPostSize() {
return this.maxHttpFormPostSize;
}
@ -465,72 +442,6 @@ public class ServerProperties {
this.basedir = basedir;
}
@DeprecatedConfigurationProperty(replacement = "server.tomcat.remoteip.internal-proxies")
@Deprecated
public String getInternalProxies() {
return this.remoteip.getInternalProxies();
}
@Deprecated
public void setInternalProxies(String internalProxies) {
this.remoteip.setInternalProxies(internalProxies);
}
@DeprecatedConfigurationProperty(replacement = "server.tomcat.remoteip.protocol-header")
@Deprecated
public String getProtocolHeader() {
return this.remoteip.getProtocolHeader();
}
@Deprecated
public void setProtocolHeader(String protocolHeader) {
this.remoteip.setProtocolHeader(protocolHeader);
}
@DeprecatedConfigurationProperty(replacement = "server.tomcat.remoteip.protocol-header-https-value")
@Deprecated
public String getProtocolHeaderHttpsValue() {
return this.remoteip.getProtocolHeaderHttpsValue();
}
@Deprecated
public void setProtocolHeaderHttpsValue(String protocolHeaderHttpsValue) {
this.remoteip.setProtocolHeaderHttpsValue(protocolHeaderHttpsValue);
}
@DeprecatedConfigurationProperty(replacement = "server.tomcat.remoteip.host-header")
@Deprecated
public String getHostHeader() {
return this.remoteip.getHostHeader();
}
@Deprecated
public void setHostHeader(String hostHeader) {
this.remoteip.setHostHeader(hostHeader);
}
@DeprecatedConfigurationProperty(replacement = "server.tomcat.remote.port-header")
@Deprecated
public String getPortHeader() {
return this.remoteip.getPortHeader();
}
@Deprecated
public void setPortHeader(String portHeader) {
this.remoteip.setPortHeader(portHeader);
}
@DeprecatedConfigurationProperty(replacement = "server.tomcat.remoteip.remote-ip-header")
@Deprecated
public String getRemoteIpHeader() {
return this.remoteip.getRemoteIpHeader();
}
@Deprecated
public void setRemoteIpHeader(String remoteIpHeader) {
this.remoteip.setRemoteIpHeader(remoteIpHeader);
}
public Boolean getRedirectContextRoot() {
return this.redirectContextRoot;
}
@ -539,11 +450,6 @@ public class ServerProperties {
this.redirectContextRoot = redirectContextRoot;
}
@Deprecated
public Boolean getUseRelativeRedirects() {
return this.useRelativeRedirects;
}
public boolean isUseRelativeRedirects() {
return this.useRelativeRedirects;
}
@ -552,11 +458,6 @@ public class ServerProperties {
this.useRelativeRedirects = useRelativeRedirects;
}
@Deprecated
public void setUseRelativeRedirects(Boolean useRelativeRedirects) {
this.useRelativeRedirects = (useRelativeRedirects != null) ? useRelativeRedirects : false;
}
public Charset getUriEncoding() {
return this.uriEncoding;
}
@ -1093,72 +994,6 @@ public class ServerProperties {
this.maxHttpFormPostSize = maxHttpFormPostSize;
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.jetty.threads.acceptors")
public Integer getAcceptors() {
return getThreads().getAcceptors();
}
@Deprecated
public void setAcceptors(Integer acceptors) {
getThreads().setAcceptors(acceptors);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.jetty.threads.selectors")
public Integer getSelectors() {
return getThreads().getSelectors();
}
@Deprecated
public void setSelectors(Integer selectors) {
getThreads().setSelectors(selectors);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.jetty.threads.min")
public Integer getMinThreads() {
return getThreads().getMin();
}
@Deprecated
public void setMinThreads(Integer minThreads) {
getThreads().setMin(minThreads);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.jetty.threads.max")
public Integer getMaxThreads() {
return getThreads().getMax();
}
@Deprecated
public void setMaxThreads(Integer maxThreads) {
getThreads().setMax(maxThreads);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.jetty.threads.max-queue-capacity")
public Integer getMaxQueueCapacity() {
return getThreads().getMaxQueueCapacity();
}
@Deprecated
public void setMaxQueueCapacity(Integer maxQueueCapacity) {
getThreads().setMaxQueueCapacity(maxQueueCapacity);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.jetty.threads.idle-timeout")
public Duration getThreadIdleTimeout() {
return getThreads().getIdleTimeout();
}
@Deprecated
public void setThreadIdleTimeout(Duration threadIdleTimeout) {
getThreads().setIdleTimeout(threadIdleTimeout);
}
public Duration getConnectionIdleTimeout() {
return this.connectionIdleTimeout;
}
@ -1579,28 +1414,6 @@ public class ServerProperties {
this.bufferSize = bufferSize;
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.undertow.threads.io")
public Integer getIoThreads() {
return getThreads().getIo();
}
@Deprecated
public void setIoThreads(Integer ioThreads) {
getThreads().setIo(ioThreads);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.undertow.threads.worker")
public Integer getWorkerThreads() {
return getThreads().getWorker();
}
@Deprecated
public void setWorkerThreads(Integer workerThreads) {
getThreads().setWorker(workerThreads);
}
public Boolean getDirectBuffers() {
return this.directBuffers;
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -46,18 +46,6 @@ public class WebConversionService extends DefaultFormattingConversionService {
private static final boolean JSR_354_PRESENT = ClassUtils.isPresent("javax.money.MonetaryAmount",
WebConversionService.class.getClassLoader());
/**
* Create a new WebConversionService that configures formatters with the provided date
* format, or register the default ones if no custom format is provided.
* @param dateFormat the custom date format to use for date conversions
* @deprecated since 2.3.0 in favor of
* {@link #WebConversionService(DateTimeFormatters)}
*/
@Deprecated
public WebConversionService(String dateFormat) {
this(new DateTimeFormatters().dateFormat(dateFormat));
}
/**
* Create a new WebConversionService that configures formatters with the provided
* date, time, and date-time formats, or registers the default if no custom format is

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.boot.autoconfigure.web.reactive;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.util.StringUtils;
/**
@ -62,17 +61,6 @@ public class WebFluxProperties {
return candidate;
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "spring.webflux.format.date")
public String getDateFormat() {
return this.format.getDate();
}
@Deprecated
public void setDateFormat(String dateFormat) {
this.format.setDate(dateFormat);
}
public Format getFormat() {
return this.format;
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -25,7 +25,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.boot.web.error.ErrorAttributeOptions;
import org.springframework.boot.web.error.ErrorAttributeOptions.Include;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
@ -70,20 +69,6 @@ public abstract class AbstractErrorController implements ErrorController {
return sorted;
}
/**
* Returns a {@link Map} of the error attributes.
* @param request the source request
* @param includeStackTrace if stack trace elements should be included
* @return the error attributes
* @deprecated since 2.3.0 in favor of
* {@link #getErrorAttributes(HttpServletRequest, ErrorAttributeOptions)}
*/
@Deprecated
protected Map<String, Object> getErrorAttributes(HttpServletRequest request, boolean includeStackTrace) {
return getErrorAttributes(request,
(includeStackTrace) ? ErrorAttributeOptions.of(Include.STACK_TRACE) : ErrorAttributeOptions.defaults());
}
protected Map<String, Object> getErrorAttributes(HttpServletRequest request, ErrorAttributeOptions options) {
WebRequest webRequest = new ServletWebRequest(request);
return this.errorAttributes.getErrorAttributes(webRequest, options);

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -81,12 +81,6 @@ public class BasicErrorController extends AbstractErrorController {
this.errorProperties = errorProperties;
}
@Override
@Deprecated
public String getErrorPath() {
return null;
}
@RequestMapping(produces = MediaType.TEXT_HTML_VALUE)
public ModelAndView errorHtml(HttpServletRequest request, HttpServletResponse response) {
HttpStatus status = getStatus(request);

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -107,16 +107,6 @@ class ElasticsearchRestClientAutoConfigurationTests {
});
}
@Test
@Deprecated
void configureWhenDeprecatedBuilderCustomizerShouldApply() {
this.contextRunner.withUserConfiguration(DeprecatedBuilderCustomizerConfiguration.class).run((context) -> {
assertThat(context).hasSingleBean(RestHighLevelClient.class);
RestHighLevelClient restClient = context.getBean(RestHighLevelClient.class);
assertThat(restClient.getLowLevelClient()).hasFieldOrPropertyWithValue("pathPrefix", "/deprecated");
});
}
@Test
void configureWithNoTimeoutsApplyDefaults() {
this.contextRunner.run((context) -> {
@ -296,17 +286,6 @@ class ElasticsearchRestClientAutoConfigurationTests {
}
@Configuration(proxyBeanMethods = false)
@Deprecated
static class DeprecatedBuilderCustomizerConfiguration {
@Bean
org.springframework.boot.autoconfigure.elasticsearch.rest.RestClientBuilderCustomizer myCustomizer() {
return (builder) -> builder.setPathPrefix("/deprecated");
}
}
@Configuration(proxyBeanMethods = false)
static class CustomRestHighLevelClientConfiguration {

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -39,16 +39,6 @@ class Saml2RelyingPartyPropertiesTests {
private final Saml2RelyingPartyProperties properties = new Saml2RelyingPartyProperties();
@Deprecated
@Test
void customizeSsoUrlDeprecated() {
bind("spring.security.saml2.relyingparty.registration.simplesamlphp.identity-provider.sso-url",
"https://simplesaml-for-spring-saml/SSOService.php");
assertThat(
this.properties.getRegistration().get("simplesamlphp").getIdentityprovider().getSinglesignon().getUrl())
.isEqualTo("https://simplesaml-for-spring-saml/SSOService.php");
}
@Test
void customizeSsoUrl() {
bind("spring.security.saml2.relyingparty.registration.simplesamlphp.identity-provider.single-sign-on.url",

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -216,105 +216,48 @@ class ServerPropertiesTests {
assertThat(this.properties.getTomcat().getThreads().getMax()).isEqualTo(10);
}
@Deprecated
@Test
void testCustomizeTomcatMaxThreadsDeprecated() {
bind("server.tomcat.maxThreads", "10");
assertThat(this.properties.getTomcat().getThreads().getMax()).isEqualTo(10);
}
@Test
void testCustomizeTomcatMinSpareThreads() {
bind("server.tomcat.threads.min-spare", "10");
assertThat(this.properties.getTomcat().getThreads().getMinSpare()).isEqualTo(10);
}
@Deprecated
@Test
void testCustomizeTomcatMinSpareThreadsDeprecated() {
bind("server.tomcat.min-spare-threads", "10");
assertThat(this.properties.getTomcat().getThreads().getMinSpare()).isEqualTo(10);
}
@Test
void testCustomizeJettyAcceptors() {
bind("server.jetty.threads.acceptors", "10");
assertThat(this.properties.getJetty().getThreads().getAcceptors()).isEqualTo(10);
}
@Deprecated
@Test
void testCustomizeJettyAcceptorsDeprecated() {
bind("server.jetty.acceptors", "10");
assertThat(this.properties.getJetty().getThreads().getAcceptors()).isEqualTo(10);
}
@Test
void testCustomizeJettySelectors() {
bind("server.jetty.threads.selectors", "10");
assertThat(this.properties.getJetty().getThreads().getSelectors()).isEqualTo(10);
}
@Deprecated
@Test
void testCustomizeJettySelectorsDeprecated() {
bind("server.jetty.selectors", "10");
assertThat(this.properties.getJetty().getSelectors()).isEqualTo(10);
assertThat(this.properties.getJetty().getThreads().getSelectors()).isEqualTo(10);
}
@Test
void testCustomizeJettyMaxThreads() {
bind("server.jetty.threads.max", "10");
assertThat(this.properties.getJetty().getThreads().getMax()).isEqualTo(10);
}
@Deprecated
@Test
void testCustomizeJettyMaxThreadsDeprecated() {
bind("server.jetty.maxThreads", "10");
assertThat(this.properties.getJetty().getThreads().getMax()).isEqualTo(10);
}
@Test
void testCustomizeJettyMinThreads() {
bind("server.jetty.threads.min", "10");
assertThat(this.properties.getJetty().getThreads().getMin()).isEqualTo(10);
}
@Deprecated
@Test
void testCustomizeJettyMinThreadsDeprecated() {
bind("server.jetty.minThreads", "10");
assertThat(this.properties.getJetty().getThreads().getMin()).isEqualTo(10);
}
@Test
void testCustomizeJettyIdleTimeout() {
bind("server.jetty.threads.idle-timeout", "10s");
assertThat(this.properties.getJetty().getThreads().getIdleTimeout()).isEqualTo(Duration.ofSeconds(10));
}
@Deprecated
@Test
void testCustomizeJettyIdleTimeoutDeprecated() {
bind("server.jetty.thread-idle-timeout", "10s");
assertThat(this.properties.getJetty().getThreads().getIdleTimeout()).hasSeconds(10);
}
@Test
void testCustomizeJettyMaxQueueCapacity() {
bind("server.jetty.threads.max-queue-capacity", "5150");
assertThat(this.properties.getJetty().getThreads().getMaxQueueCapacity()).isEqualTo(5150);
}
@Deprecated
@Test
void testCustomizeJettyMaxQueueCapacityDeprecated() {
bind("server.jetty.max-queue-capacity", "5150");
assertThat(this.properties.getJetty().getThreads().getMaxQueueCapacity()).isEqualTo(5150);
}
@Test
void testCustomizeUndertowServerOption() {
bind("server.undertow.options.server.ALWAYS_SET_KEEP_ALIVE", "true");
@ -335,26 +278,12 @@ class ServerPropertiesTests {
assertThat(this.properties.getUndertow().getThreads().getIo()).isEqualTo(4);
}
@Deprecated
@Test
void testCustomizeUndertowIoThreadsDeprecated() {
bind("server.undertow.ioThreads", "4");
assertThat(this.properties.getUndertow().getThreads().getIo()).isEqualTo(4);
}
@Test
void testCustomizeUndertowWorkerThreads() {
bind("server.undertow.threads.worker", "10");
assertThat(this.properties.getUndertow().getThreads().getWorker()).isEqualTo(10);
}
@Deprecated
@Test
void testCustomizeUndertowWorkerThreadsDeprecated() {
bind("server.undertow.workerThreads", "10");
assertThat(this.properties.getUndertow().getThreads().getWorker()).isEqualTo(10);
}
@Test
void testCustomizeJettyAccessLog() {
Map<String, String> map = new HashMap<>();

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -164,7 +164,7 @@ class JettyWebServerFactoryCustomizerTests {
@Test
void threadPoolMaxThreadsCanBeCustomized() {
bind("server.jetty.max-threads=100");
bind("server.jetty.threads.max=100");
JettyWebServer server = customizeAndGetServer();
QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool();
assertThat(threadPool.getMaxThreads()).isEqualTo(100);
@ -172,7 +172,7 @@ class JettyWebServerFactoryCustomizerTests {
@Test
void threadPoolMinThreadsCanBeCustomized() {
bind("server.jetty.min-threads=100");
bind("server.jetty.threads.min=100");
JettyWebServer server = customizeAndGetServer();
QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool();
assertThat(threadPool.getMinThreads()).isEqualTo(100);
@ -198,8 +198,8 @@ class JettyWebServerFactoryCustomizerTests {
@Test
void threadPoolWithMaxQueueCapacityEqualToZeroCustomizesThreadPool() {
bind("server.jetty.threads.max-queue-capacity=0", "server.jetty.min-threads=100",
"server.jetty.max-threads=100", "server.jetty.threads.idle-timeout=6s");
bind("server.jetty.threads.max-queue-capacity=0", "server.jetty.threads.min=100",
"server.jetty.threads.max=100", "server.jetty.threads.idle-timeout=6s");
JettyWebServer server = customizeAndGetServer();
QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool();
assertThat(threadPool.getMinThreads()).isEqualTo(100);
@ -220,8 +220,8 @@ class JettyWebServerFactoryCustomizerTests {
@Test
void threadPoolWithMaxQueueCapacityPositiveCustomizesThreadPool() {
bind("server.jetty.threads.max-queue-capacity=1234", "server.jetty.min-threads=10",
"server.jetty.max-threads=150", "server.jetty.threads.idle-timeout=3s");
bind("server.jetty.threads.max-queue-capacity=1234", "server.jetty.threads.min=10",
"server.jetty.threads.max=150", "server.jetty.threads.idle-timeout=3s");
JettyWebServer server = customizeAndGetServer();
QueuedThreadPool threadPool = (QueuedThreadPool) server.getServer().getThreadPool();
assertThat(threadPool.getMinThreads()).isEqualTo(10);

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -186,26 +186,6 @@ class TomcatWebServerFactoryCustomizerTests {
assertThat(remoteIpValve.getInternalProxies()).isEqualTo("192.168.0.1");
}
@Test
@Deprecated
void customRemoteIpValveWithDeprecatedProperties() {
bind("server.tomcat.remote-ip-header=x-my-remote-ip-header",
"server.tomcat.protocol-header=x-my-protocol-header", "server.tomcat.internal-proxies=192.168.0.1",
"server.tomcat.host-header=x-my-forward-host", "server.tomcat.port-header=x-my-forward-port",
"server.tomcat.protocol-header-https-value=On");
TomcatServletWebServerFactory factory = customizeAndGetFactory();
assertThat(factory.getEngineValves()).hasSize(1);
Valve valve = factory.getEngineValves().iterator().next();
assertThat(valve).isInstanceOf(RemoteIpValve.class);
RemoteIpValve remoteIpValve = (RemoteIpValve) valve;
assertThat(remoteIpValve.getProtocolHeader()).isEqualTo("x-my-protocol-header");
assertThat(remoteIpValve.getProtocolHeaderHttpsValue()).isEqualTo("On");
assertThat(remoteIpValve.getRemoteIpHeader()).isEqualTo("x-my-remote-ip-header");
assertThat(remoteIpValve.getHostHeader()).isEqualTo("x-my-forward-host");
assertThat(remoteIpValve.getPortHeader()).isEqualTo("x-my-forward-port");
assertThat(remoteIpValve.getInternalProxies()).isEqualTo("192.168.0.1");
}
@Test
void customStaticResourceAllowCaching() {
bind("server.tomcat.resource.allow-caching=false");

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -212,15 +212,6 @@ class WebFluxAutoConfigurationTests {
});
}
@Test
void customDateFormatWithDeprecatedProperty() {
this.contextRunner.withPropertyValues("spring.webflux.date-format:dd*MM*yyyy").run((context) -> {
FormattingConversionService conversionService = context.getBean(FormattingConversionService.class);
Date date = Date.from(ZonedDateTime.of(1988, 6, 25, 20, 30, 0, 0, ZoneId.systemDefault()).toInstant());
assertThat(conversionService.convert(date, String.class)).isEqualTo("25*06*1988");
});
}
@Test
void customDateFormat() {
this.contextRunner.withPropertyValues("spring.webflux.format.date:dd*MM*yyyy").run((context) -> {

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -36,6 +36,7 @@ import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplic
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import org.springframework.boot.web.error.ErrorAttributeOptions;
import org.springframework.boot.web.reactive.error.DefaultErrorAttributes;
import org.springframework.boot.web.reactive.error.ErrorAttributes;
import org.springframework.context.annotation.Bean;
@ -337,7 +338,7 @@ class DefaultErrorWebExceptionHandlerIntegrationTests {
}
@Test
void defaultErrorAttributesSubclassUsingDeprecatedApiAndDelegation() {
void defaultErrorAttributesSubclassUsingDelegation() {
this.contextRunner.withUserConfiguration(CustomErrorAttributesWithDelegation.class).run((context) -> {
WebTestClient client = getWebClient(context);
client.get().uri("/badRequest").exchange().expectStatus().isBadRequest().expectBody().jsonPath("status")
@ -347,7 +348,7 @@ class DefaultErrorWebExceptionHandlerIntegrationTests {
}
@Test
void defaultErrorAttributesSubclassUsingDeprecatedApiWithoutDelegation() {
void defaultErrorAttributesSubclassWithoutDelegation() {
this.contextRunner.withUserConfiguration(CustomErrorAttributesWithoutDelegation.class).run((context) -> {
WebTestClient client = getWebClient(context);
client.get().uri("/badRequest").exchange().expectStatus().isBadRequest().expectBody().jsonPath("status")
@ -425,9 +426,8 @@ class DefaultErrorWebExceptionHandlerIntegrationTests {
ErrorAttributes errorAttributes() {
return new DefaultErrorAttributes() {
@Override
@SuppressWarnings("deprecation")
public Map<String, Object> getErrorAttributes(ServerRequest request, boolean includeStackTrace) {
Map<String, Object> errorAttributes = super.getErrorAttributes(request, includeStackTrace);
public Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options) {
Map<String, Object> errorAttributes = super.getErrorAttributes(request, options);
errorAttributes.put("error", "custom error");
errorAttributes.put("newAttribute", "value");
errorAttributes.remove("path");
@ -446,8 +446,7 @@ class DefaultErrorWebExceptionHandlerIntegrationTests {
ErrorAttributes errorAttributes() {
return new DefaultErrorAttributes() {
@Override
@SuppressWarnings("deprecation")
public Map<String, Object> getErrorAttributes(ServerRequest request, boolean includeStackTrace) {
public Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options) {
Map<String, Object> errorAttributes = new HashMap<>();
errorAttributes.put("status", 400);
errorAttributes.put("error", "custom error");

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -128,26 +128,4 @@ public interface BootArchive extends Task {
*/
void setClasspath(FileCollection classpath);
/**
* Returns {@code true} if the Devtools jar should be excluded, otherwise
* {@code false}.
* @return {@code true} if the Devtools jar should be excluded, or {@code false} if
* not
* @deprecated since 2.3.0 in favour of configuring a classpath that does not include
* development-only dependencies
*/
@Input
@Deprecated
boolean isExcludeDevtools();
/**
* Sets whether or not the Devtools jar should be excluded.
* @param excludeDevtools {@code true} if the Devtools jar should be excluded, or
* {@code false} if not
* @deprecated since 2.3.0 in favour of configuring a classpath that does not include
* development-only dependencies
*/
@Deprecated
void setExcludeDevtools(boolean excludeDevtools);
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -76,15 +76,12 @@ class BootArchiveSupport {
private LaunchScriptConfiguration launchScript;
private boolean excludeDevtools = false;
BootArchiveSupport(String loaderMainClass, Spec<FileCopyDetails> librarySpec,
Function<FileCopyDetails, ZipCompression> compressionResolver) {
this.loaderMainClass = loaderMainClass;
this.librarySpec = librarySpec;
this.compressionResolver = compressionResolver;
this.requiresUnpack.include(Specs.satisfyNone());
configureExclusions();
}
void configureManifest(Manifest manifest, String mainClass, String classes, String lib, String classPathIndex,
@ -149,15 +146,6 @@ class BootArchiveSupport {
this.requiresUnpack.include(spec);
}
boolean isExcludeDevtools() {
return this.excludeDevtools;
}
void setExcludeDevtools(boolean excludeDevtools) {
this.excludeDevtools = excludeDevtools;
configureExclusions();
}
void excludeNonZipLibraryFiles(FileCopyDetails details) {
if (this.librarySpec.isSatisfiedBy(details)) {
excludeNonZipFiles(details);
@ -190,14 +178,6 @@ class BootArchiveSupport {
return true;
}
private void configureExclusions() {
Set<String> excludes = new HashSet<>();
if (this.excludeDevtools) {
excludes.add("**/spring-boot-devtools-*.jar");
}
this.exclusions.setExcludes(excludes);
}
void moveModuleInfoToRoot(CopySpec spec) {
spec.filesMatching("module-info.class", BootArchiveSupport::moveToRoot);
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -22,8 +22,6 @@ import java.util.concurrent.Callable;
import java.util.function.Function;
import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.ResolvableDependencies;
import org.gradle.api.file.CopySpec;
import org.gradle.api.file.FileCollection;
@ -128,18 +126,6 @@ public class BootJar extends Jar implements BootArchive {
return this.support.createCopyAction(this);
}
/**
* Returns the {@link Configuration Configurations} of the project associated with
* this task.
* @return the configurations
* @deprecated since 2.3.5 in favor of {@link Project#getConfigurations}
*/
@Internal
@Deprecated
protected Iterable<Configuration> getConfigurations() {
return getProject().getConfigurations();
}
@Override
public Property<String> getMainClass() {
return this.mainClass;
@ -232,18 +218,6 @@ public class BootJar extends Jar implements BootArchive {
this.classpath = getProject().files(classpath);
}
@Override
@Deprecated
public boolean isExcludeDevtools() {
return this.support.isExcludeDevtools();
}
@Override
@Deprecated
public void setExcludeDevtools(boolean excludeDevtools) {
this.support.setExcludeDevtools(excludeDevtools);
}
/**
* Returns a {@code CopySpec} that can be used to add content to the {@code BOOT-INF}
* directory of the jar.

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -169,18 +169,6 @@ public class BootWar extends War implements BootArchive {
this.providedClasspath = getProject().files(classpath);
}
@Override
@Deprecated
public boolean isExcludeDevtools() {
return this.support.isExcludeDevtools();
}
@Override
@Deprecated
public void setExcludeDevtools(boolean excludeDevtools) {
this.support.setExcludeDevtools(excludeDevtools);
}
/**
* Return the {@link ZipCompression} that should be used when adding the file
* represented by the given {@code details} to the jar. By default, any

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -369,19 +369,6 @@ abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
}
}
@Test
@Deprecated
void devtoolsJarCanBeIncluded() throws IOException {
this.task.getMainClass().set("com.example.Main");
this.task.classpath(jarFile("spring-boot-devtools-0.1.2.jar"));
this.task.setExcludeDevtools(false);
executeTask();
assertThat(this.task.getArchiveFile().get().getAsFile()).exists();
try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) {
assertThat(jarFile.getEntry(this.libPath + "spring-boot-devtools-0.1.2.jar")).isNotNull();
}
}
@Test
void allEntriesUseUnixPlatformAndUtf8NameEncoding() throws IOException {
this.task.getMainClass().set("com.example.Main");

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -80,18 +80,6 @@ class BootWarTests extends AbstractBootArchiveTests<BootWar> {
}
}
@Test
@Deprecated
void devtoolsJarCanBeIncludedWhenItsOnTheProvidedClasspath() throws IOException {
getTask().getMainClass().set("com.example.Main");
getTask().providedClasspath(jarFile("spring-boot-devtools-0.1.2.jar"));
getTask().setExcludeDevtools(false);
executeTask();
try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) {
assertThat(jarFile.getEntry("WEB-INF/lib-provided/spring-boot-devtools-0.1.2.jar")).isNotNull();
}
}
@Test
void webappResourcesInDirectoriesThatOverlapWithLoaderCanBePackaged() throws IOException {
File webappDirectory = new File(this.temp, "src/main/webapp");

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -42,20 +42,7 @@ public interface Layout {
* @return the location of the library relative to the root of the archive (should end
* with '/') or {@code null} if the library should not be included.
*/
default String getLibraryLocation(String libraryName, LibraryScope scope) {
return getLibraryDestination(libraryName, scope);
}
/**
* Returns the destination path for a given library.
* @param libraryName the name of the library (excluding any path)
* @param scope the scope of the library
* @return the destination relative to the root of the archive (should end with '/')
* or {@code null} if the library should not be included.
* @deprecated since 2.3.0 in favor of {@link #getLibraryLocation}
*/
@Deprecated
String getLibraryDestination(String libraryName, LibraryScope scope);
String getLibraryLocation(String libraryName, LibraryScope scope);
/**
* Returns the location of classes within the archive.

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -73,12 +73,6 @@ public final class Layouts {
return "BOOT-INF/lib/";
}
@Deprecated
@Override
public String getLibraryDestination(String libraryName, LibraryScope scope) {
return "BOOT-INF/lib/";
}
@Override
public String getClassesLocation() {
return "";
@ -161,12 +155,6 @@ public final class Layouts {
return SCOPE_LOCATION.get(scope);
}
@Deprecated
@Override
public String getLibraryDestination(String libraryName, LibraryScope scope) {
return SCOPE_LOCATION.get(scope);
}
@Override
public String getClassesLocation() {
return "WEB-INF/classes/";

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -175,16 +175,6 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
@Parameter(property = "spring-boot.run.main-class")
private String mainClass;
/**
* Additional directories besides the classes directory that should be added to the
* classpath.
* @since 1.0.0
* @deprecated since 2.3.0 in favor of {@code directories}
*/
@Deprecated
@Parameter(property = "spring-boot.run.folders")
private String[] folders;
/**
* Additional directories besides the classes directory that should be added to the
* classpath.
@ -462,11 +452,6 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
}
private void addUserDefinedDirectories(List<URL> urls) throws MalformedURLException {
if (this.folders != null) {
for (String folder : this.folders) {
urls.add(new File(folder).toURI().toURL());
}
}
if (this.directories != null) {
for (String directory : this.directories) {
urls.add(new File(directory).toURI().toURL());

@ -423,7 +423,7 @@ public class SpringApplication {
// Not allowed in some environments.
}
}
refresh((ApplicationContext) context);
refresh(context);
}
private void configureHeadlessProperty() {
@ -747,18 +747,6 @@ public class SpringApplication {
return new BeanDefinitionLoader(registry, sources);
}
/**
* Refresh the underlying {@link ApplicationContext}.
* @param applicationContext the application context to refresh
* @deprecated since 2.3.0 in favor of
* {@link #refresh(ConfigurableApplicationContext)}
*/
@Deprecated
protected void refresh(ApplicationContext applicationContext) {
Assert.isInstanceOf(ConfigurableApplicationContext.class, applicationContext);
refresh((ConfigurableApplicationContext) applicationContext);
}
/**
* Refresh the underlying {@link ApplicationContext}.
* @param applicationContext the application context to refresh

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -21,7 +21,6 @@ import io.undertow.Undertow.Builder;
import io.undertow.server.HttpHandler;
import io.undertow.servlet.api.DeploymentManager;
import org.springframework.boot.web.server.Compression;
import org.springframework.boot.web.server.WebServer;
import org.springframework.util.StringUtils;
@ -44,58 +43,6 @@ public class UndertowServletWebServer extends UndertowWebServer {
private final DeploymentManager manager;
/**
* Create a new {@link UndertowServletWebServer} instance.
* @param builder the builder
* @param manager the deployment manager
* @param contextPath the root context path
* @param autoStart if the server should be started
* @param compression compression configuration
* @deprecated since 2.3.0 in favor of
* {@link #UndertowServletWebServer(io.undertow.Undertow.Builder, Iterable, String, boolean)}
*/
@Deprecated
public UndertowServletWebServer(Builder builder, DeploymentManager manager, String contextPath, boolean autoStart,
Compression compression) {
this(builder, manager, contextPath, false, autoStart, compression);
}
/**
* Create a new {@link UndertowServletWebServer} instance.
* @param builder the builder
* @param manager the deployment manager
* @param contextPath the root context path
* @param useForwardHeaders if x-forward headers should be used
* @param autoStart if the server should be started
* @param compression compression configuration
* @deprecated since 2.3.0 in favor of
* {@link #UndertowServletWebServer(io.undertow.Undertow.Builder, Iterable, String, boolean)}
*/
@Deprecated
public UndertowServletWebServer(Builder builder, DeploymentManager manager, String contextPath,
boolean useForwardHeaders, boolean autoStart, Compression compression) {
this(builder, manager, contextPath, useForwardHeaders, autoStart, compression, null);
}
/**
* Create a new {@link UndertowServletWebServer} instance.
* @param builder the builder
* @param manager the deployment manager
* @param contextPath the root context path
* @param useForwardHeaders if x-forward headers should be used
* @param autoStart if the server should be started
* @param compression compression configuration
* @param serverHeader string to be used in HTTP header
* @deprecated since 2.3.0 in favor of
* {@link #UndertowServletWebServer(io.undertow.Undertow.Builder, Iterable, String, boolean)}
*/
@Deprecated
public UndertowServletWebServer(Builder builder, DeploymentManager manager, String contextPath,
boolean useForwardHeaders, boolean autoStart, Compression compression, String serverHeader) {
this(builder, UndertowWebServerFactoryDelegate.createHttpHandlerFactories(compression, useForwardHeaders,
serverHeader, null, new DeploymentManagerHttpHandlerFactory(manager)), contextPath, autoStart);
}
/**
* Create a new {@link UndertowServletWebServer} instance.
* @param builder the builder

@ -83,21 +83,7 @@ public class UndertowWebServer implements WebServer {
* @param autoStart if the server should be started
*/
public UndertowWebServer(Undertow.Builder builder, boolean autoStart) {
this(builder, autoStart, null);
}
/**
* Create a new {@link UndertowWebServer} instance.
* @param builder the builder
* @param autoStart if the server should be started
* @param closeable called when the server is stopped
* @since 2.0.4
* @deprecated since 2.3.0 in favor of
* {@link #UndertowWebServer(io.undertow.Undertow.Builder, Iterable, boolean)}
*/
@Deprecated
public UndertowWebServer(Undertow.Builder builder, boolean autoStart, Closeable closeable) {
this(builder, Collections.singleton(new CloseableHttpHandlerFactory(closeable)), autoStart);
this(builder, Collections.singleton(new CloseableHttpHandlerFactory(null)), autoStart);
}
/**

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -63,32 +63,9 @@ public class DefaultErrorAttributes implements ErrorAttributes {
private static final String ERROR_ATTRIBUTE = DefaultErrorAttributes.class.getName() + ".ERROR";
private final Boolean includeException;
/**
* Create a new {@link DefaultErrorAttributes} instance.
*/
public DefaultErrorAttributes() {
this.includeException = null;
}
/**
* Create a new {@link DefaultErrorAttributes} instance.
* @param includeException whether to include the "exception" attribute
* @deprecated since 2.3.0 in favor of
* {@link ErrorAttributeOptions#including(Include...)}
*/
@Deprecated
public DefaultErrorAttributes(boolean includeException) {
this.includeException = includeException;
}
@Override
public Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options) {
Map<String, Object> errorAttributes = getErrorAttributes(request, options.isIncluded(Include.STACK_TRACE));
if (Boolean.TRUE.equals(this.includeException)) {
options = options.including(Include.EXCEPTION);
}
if (!options.isIncluded(Include.EXCEPTION)) {
errorAttributes.remove("exception");
}
@ -104,9 +81,7 @@ public class DefaultErrorAttributes implements ErrorAttributes {
return errorAttributes;
}
@Override
@Deprecated
public Map<String, Object> getErrorAttributes(ServerRequest request, boolean includeStackTrace) {
private Map<String, Object> getErrorAttributes(ServerRequest request, boolean includeStackTrace) {
Map<String, Object> errorAttributes = new LinkedHashMap<>();
errorAttributes.put("timestamp", new Date());
errorAttributes.put("path", request.path());

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -20,7 +20,6 @@ import java.util.Collections;
import java.util.Map;
import org.springframework.boot.web.error.ErrorAttributeOptions;
import org.springframework.boot.web.error.ErrorAttributeOptions.Include;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import org.springframework.web.server.ServerWebExchange;
@ -35,20 +34,6 @@ import org.springframework.web.server.ServerWebExchange;
*/
public interface ErrorAttributes {
/**
* Return a {@link Map} of the error attributes. The map can be used as the model of
* an error page, or returned as a {@link ServerResponse} body.
* @param request the source request
* @param includeStackTrace if stack trace attribute should be included
* @return a map of error attributes
* @deprecated since 2.3.0 in favor of
* {@link #getErrorAttributes(ServerRequest, ErrorAttributeOptions)}
*/
@Deprecated
default Map<String, Object> getErrorAttributes(ServerRequest request, boolean includeStackTrace) {
return Collections.emptyMap();
}
/**
* Return a {@link Map} of the error attributes. The map can be used as the model of
* an error page, or returned as a {@link ServerResponse} body.
@ -57,7 +42,7 @@ public interface ErrorAttributes {
* @return a map of error attributes
*/
default Map<String, Object> getErrorAttributes(ServerRequest request, ErrorAttributeOptions options) {
return getErrorAttributes(request, options.isIncluded(Include.STACK_TRACE));
return Collections.emptyMap();
}
/**

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -70,26 +70,6 @@ public class DefaultErrorAttributes implements ErrorAttributes, HandlerException
private static final String ERROR_ATTRIBUTE = DefaultErrorAttributes.class.getName() + ".ERROR";
private final Boolean includeException;
/**
* Create a new {@link DefaultErrorAttributes} instance.
*/
public DefaultErrorAttributes() {
this.includeException = null;
}
/**
* Create a new {@link DefaultErrorAttributes} instance.
* @param includeException whether to include the "exception" attribute
* @deprecated since 2.3.0 in favor of
* {@link ErrorAttributeOptions#including(Include...)}
*/
@Deprecated
public DefaultErrorAttributes(boolean includeException) {
this.includeException = includeException;
}
@Override
public int getOrder() {
return Ordered.HIGHEST_PRECEDENCE;
@ -109,9 +89,6 @@ public class DefaultErrorAttributes implements ErrorAttributes, HandlerException
@Override
public Map<String, Object> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) {
Map<String, Object> errorAttributes = getErrorAttributes(webRequest, options.isIncluded(Include.STACK_TRACE));
if (Boolean.TRUE.equals(this.includeException)) {
options = options.including(Include.EXCEPTION);
}
if (!options.isIncluded(Include.EXCEPTION)) {
errorAttributes.remove("exception");
}
@ -127,9 +104,7 @@ public class DefaultErrorAttributes implements ErrorAttributes, HandlerException
return errorAttributes;
}
@Override
@Deprecated
public Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
private Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
Map<String, Object> errorAttributes = new LinkedHashMap<>();
errorAttributes.put("timestamp", new Date());
addStatus(errorAttributes, webRequest);

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -20,7 +20,6 @@ import java.util.Collections;
import java.util.Map;
import org.springframework.boot.web.error.ErrorAttributeOptions;
import org.springframework.boot.web.error.ErrorAttributeOptions.Include;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.ModelAndView;
@ -35,21 +34,6 @@ import org.springframework.web.servlet.ModelAndView;
*/
public interface ErrorAttributes {
/**
* Returns a {@link Map} of the error attributes. The map can be used as the model of
* an error page {@link ModelAndView}, or returned as a
* {@link ResponseBody @ResponseBody}.
* @param webRequest the source request
* @param includeStackTrace if stack trace element should be included
* @return a map of error attributes
* @deprecated since 2.3.0 in favor of
* {@link #getErrorAttributes(WebRequest, ErrorAttributeOptions)}
*/
@Deprecated
default Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
return Collections.emptyMap();
}
/**
* Returns a {@link Map} of the error attributes. The map can be used as the model of
* an error page {@link ModelAndView}, or returned as a
@ -60,7 +44,7 @@ public interface ErrorAttributes {
* @since 2.3.0
*/
default Map<String, Object> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) {
return getErrorAttributes(webRequest, options.isIncluded(Include.STACK_TRACE));
return Collections.emptyMap();
}
/**

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -26,16 +26,6 @@ import org.springframework.stereotype.Controller;
* @author Scott Frederick
* @since 2.0.0
*/
@FunctionalInterface
public interface ErrorController {
/**
* The return value from this method is not used; the property `server.error.path`
* must be set to override the default error page path.
* @return the error path
* @deprecated since 2.3.0 in favor of setting the property `server.error.path`
*/
@Deprecated
String getErrorPath();
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -164,19 +164,6 @@ class DefaultErrorAttributesTests {
assertThat(attributes.get("message")).isEqualTo("Test");
}
@Test
@SuppressWarnings("deprecation")
void excludeExceptionWithDeprecatedConstructor() {
RuntimeException error = new RuntimeException("Test");
this.errorAttributes = new DefaultErrorAttributes(false);
MockServerHttpRequest request = MockServerHttpRequest.get("/test").build();
ServerRequest serverRequest = buildServerRequest(request, error);
Map<String, Object> attributes = this.errorAttributes.getErrorAttributes(serverRequest,
ErrorAttributeOptions.of());
assertThat(this.errorAttributes.getError(serverRequest)).isSameAs(error);
assertThat(attributes.get("exception")).isNull();
}
@Test
void processResponseStatusException() {
RuntimeException nested = new RuntimeException("Test");

@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@ -231,17 +231,6 @@ class DefaultErrorAttributesTests {
assertThat(attributes.get("message")).isEqualTo("Test");
}
@Test
@SuppressWarnings("deprecation")
void excludeExceptionAttributeWithDeprecatedConstructor() {
DefaultErrorAttributes errorAttributes = new DefaultErrorAttributes(false);
RuntimeException ex = new RuntimeException("Test");
this.request.setAttribute("javax.servlet.error.exception", ex);
Map<String, Object> attributes = errorAttributes.getErrorAttributes(this.webRequest,
ErrorAttributeOptions.of());
assertThat(attributes.get("exception")).isNull();
}
@Test
void withStackTraceAttribute() {
RuntimeException ex = new RuntimeException("Test");

Loading…
Cancel
Save