Merge branch '4.1.x'

Closes gh-51455
This commit is contained in:
Phillip Webb
2026-08-25 14:19:47 -07:00
65 changed files with 145 additions and 77 deletions
@@ -29,6 +29,7 @@
<suppress files="[\\/]spring-boot-docs[\\/].*MyConfiguration__BeanDefinitions" checks="JavadocMethod|SpringHideUtilityClassConstructor" />
<suppress files="[\\/]smoke-test[\\/]" checks="JavadocType" />
<suppress files="[\\/]smoke-test[\\/]" checks="ImportControl" />
<suppress files="[\\/]smoke-test[\\/]" checks="MissingJavadocPackage" />
<suppress files="[\\/]smoke-test[\\/].*SamplePulsarApplicationTests" checks="SpringHideUtilityClassConstructor" />
<suppress files="[\\/]smoke-test[\\/]" id="mainCodeIllegalImportCheck" />
<suppress files="[\\/]system-test[\\/]spring-boot-deployment-system-tests[\\/]" checks="JavadocPackage|JavadocType" />
@@ -442,7 +442,7 @@ public final class ConditionMessage {
return result;
}
protected abstract @Nullable Object applyToItem(@Nullable Object item);
abstract @Nullable Object applyToItem(@Nullable Object item);
}
@@ -25,6 +25,7 @@ package org.springframework.boot.ansi;
public interface AnsiElement {
/**
* Return the ANSI escape code.
* @return the ANSI escape code
*/
@Override
@@ -65,7 +65,7 @@ public abstract class AnsiOutput {
}
/**
* Returns if ANSI output is enabled
* Returns if ANSI output is enabled.
* @return if ANSI enabled, disabled or detected
*/
public static Enabled getEnabled() {
@@ -52,7 +52,7 @@ class ConfigDataProperties {
* @param imports the imports requested
* @param activate the activate properties
*/
ConfigDataProperties(@Nullable @Name("import") List<ConfigDataLocation> imports, @Nullable Activate activate) {
ConfigDataProperties(@Name("import") @Nullable List<ConfigDataLocation> imports, @Nullable Activate activate) {
this.imports = (imports != null) ? imports.stream().filter(ConfigDataLocation::isNotEmpty).toList()
: Collections.emptyList();
this.activate = activate;
@@ -125,7 +125,7 @@ public final class ColorConverter extends LogEventPatternConverter {
toAppendTo.append(AnsiOutput.toString(element, in));
}
protected void appendAnsiString(StringBuilder toAppendTo, String in, AnsiElement... elements) {
void appendAnsiString(StringBuilder toAppendTo, String in, AnsiElement... elements) {
Object[] ansiParams = new Object[elements.length + 1];
System.arraycopy(elements, 0, ansiParams, 0, elements.length);
ansiParams[elements.length] = in;
@@ -43,7 +43,7 @@ class ReflectionEnvironmentPostProcessorsFactory implements EnvironmentPostProce
private @Nullable ClassLoader classLoader;
private @Nullable final List<String> classNames;
private final @Nullable List<String> classNames;
ReflectionEnvironmentPostProcessorsFactory(Class<?>... classes) {
this.classes = new ArrayList<>(Arrays.asList(classes));
@@ -88,7 +88,6 @@ public class SystemEnvironmentPropertySourceEnvironmentPostProcessor implements
* settings from a parent {@link ConfigurableEnvironment}.
* @param environment the environment to post-process
* @param parentEnvironment the parent environment
* @since 3.4.12
*/
public static void postProcessEnvironment(ConfigurableEnvironment environment,
ConfigurableEnvironment parentEnvironment) {
@@ -42,6 +42,7 @@ import org.springframework.boot.convert.Delimiter;
import org.springframework.core.ResolvableType;
import org.springframework.core.convert.ConversionService;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
@@ -1062,7 +1063,7 @@ class JavaBeanBinderTests {
static class ConverterAnnotatedExampleBean {
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
@DateTimeFormat(iso = ISO.DATE)
private @Nullable LocalDate date;
@Nullable LocalDate getDate() {
@@ -38,6 +38,7 @@ import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.ResolvableType;
import org.springframework.core.convert.ConversionService;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
import org.springframework.util.Assert;
import static org.assertj.core.api.Assertions.assertThat;
@@ -697,8 +698,8 @@ class ValueObjectBinderTests {
private final String bar;
ConverterAnnotatedExampleBean(
@DefaultValue("2019-05-10") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, String bar) {
ConverterAnnotatedExampleBean(@DefaultValue("2019-05-10") @DateTimeFormat(iso = ISO.DATE) LocalDate date,
String bar) {
this.date = date;
this.bar = bar;
}
+6
View File
@@ -13,9 +13,15 @@ graalVersion=25
hamcrestVersion=3.0
jackson2Version=2.21.5
jacksonVersion=3.1.5
<<<<<<< HEAD
javaFormatVersion=0.0.47
junitJupiterVersion=6.1.3
kotlinVersion=2.4.10
=======
javaFormatVersion=0.0.48
junitJupiterVersion=6.0.3
kotlinVersion=2.3.21
>>>>>>> 4.1.x
mavenVersion=3.9.13
mockitoVersion=5.23.0
nativeBuildToolsVersion=1.1.8
@@ -39,7 +39,7 @@ import org.springframework.util.Assert;
@Endpoint(id = "shutdown", defaultAccess = Access.NONE)
public class ShutdownEndpoint implements ApplicationContextAware {
@Nullable private ConfigurableApplicationContext context;
private @Nullable ConfigurableApplicationContext context;
@WriteOperation
public ShutdownDescriptor shutdown() {
@@ -27,6 +27,7 @@ import java.util.regex.PatternSyntaxException;
import java.util.stream.Stream;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.actuate.endpoint.InvalidEndpointRequestException;
@@ -252,7 +253,7 @@ public class EnvironmentEndpoint {
/**
* Description of an entry of the {@link Environment}.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(Include.NON_NULL)
public static final class EnvironmentEntryDescriptor {
private final @Nullable PropertySummaryDescriptor property;
@@ -292,7 +293,7 @@ public class EnvironmentEndpoint {
/**
* Description of a particular entry of the {@link Environment}.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(Include.NON_NULL)
public static final class PropertySummaryDescriptor {
private final String source;
@@ -341,7 +342,7 @@ public class EnvironmentEndpoint {
/**
* Description of a particular entry of {@link PropertySource}.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(Include.NON_NULL)
public static final class PropertySourceEntryDescriptor {
private final String name;
@@ -366,7 +367,7 @@ public class EnvironmentEndpoint {
/**
* Description of a property's value, including its origin if available.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(Include.NON_NULL)
public static final class PropertyValueDescriptor {
private final @Nullable Object value;
@@ -60,7 +60,7 @@ public final class RabbitAmqpListenerContainerFactoryConfigurer {
* converter should be used.
* @param messageConverter the {@link MessageConverter}
*/
protected void setMessageConverter(@Nullable MessageConverter messageConverter) {
void setMessageConverter(@Nullable MessageConverter messageConverter) {
this.messageConverter = messageConverter;
}
@@ -68,7 +68,7 @@ public final class RabbitAmqpListenerContainerFactoryConfigurer {
* Set the {@link TaskScheduler} to use or {@code null} if the default should be used.
* @param taskScheduler the {@link TaskScheduler}
*/
protected void setTaskScheduler(@Nullable TaskScheduler taskScheduler) {
void setTaskScheduler(@Nullable TaskScheduler taskScheduler) {
this.taskScheduler = taskScheduler;
}
@@ -101,12 +101,12 @@ abstract class AbstractDevToolsIntegrationTests {
this.classesDirectory = classesDirectory;
}
protected ControllerBuilder withRequestMapping(String mapping) {
ControllerBuilder withRequestMapping(String mapping) {
this.mappings.add(mapping);
return this;
}
protected void build() throws Exception {
void build() throws Exception {
DynamicType.Builder<Object> builder = new ByteBuddy().subclass(Object.class)
.name(this.name)
.annotateType(AnnotationDescription.Builder.ofType(RestController.class).build());
@@ -21,6 +21,7 @@ import io.grpc.servlet.jakarta.GrpcServlet;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.diagnostics.FailureAnalyzedException;
import org.springframework.boot.grpc.server.GrpcServletRegistration;
import org.springframework.context.annotation.Bean;
@@ -38,7 +39,7 @@ import org.springframework.grpc.server.service.GrpcServiceDiscoverer;
* @author Phillip Webb
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
@ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass(GrpcServlet.class)
@ConditionalOnMissingNetworkGrpcServer
@ConditionalOnBooleanProperty(name = "spring.grpc.server.servlet.enabled", matchIfMissing = true)
@@ -14,6 +14,9 @@
* limitations under the License.
*/
/**
* Auto-configuration for application health indicators.
*/
@NullMarked
package org.springframework.boot.health.autoconfigure.application;
@@ -34,6 +34,7 @@ import org.springframework.aot.test.generate.TestGenerationContext;
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution;
import org.springframework.beans.factory.aot.BeanFactoryInitializationCode;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.jackson.JacksonComponent.Scope;
import org.springframework.boot.jackson.JacksonComponentModule.JacksonComponentBeanFactoryInitializationAotProcessor;
import org.springframework.boot.jackson.JacksonComponentModuleTests.ComponentWithInnerAbstractClass.AbstractSerializer;
import org.springframework.boot.jackson.JacksonComponentModuleTests.ComponentWithInnerAbstractClass.ConcreteSerializer;
@@ -236,12 +237,12 @@ class JacksonComponentModuleTests {
}
@JacksonComponent(scope = JacksonComponent.Scope.KEYS)
@JacksonComponent(scope = Scope.KEYS)
static class OnlyKeySerializer extends NameAndAgeJacksonKeyComponent.Serializer {
}
@JacksonComponent(scope = JacksonComponent.Scope.KEYS, type = NameAndAge.class)
@JacksonComponent(scope = Scope.KEYS, type = NameAndAge.class)
static class OnlyKeyDeserializer extends NameAndAgeJacksonKeyComponent.Deserializer {
}
@@ -22,6 +22,7 @@ import tools.jackson.databind.KeyDeserializer;
import tools.jackson.databind.SerializationContext;
import tools.jackson.databind.ValueSerializer;
import org.springframework.boot.jackson.JacksonComponent.Scope;
import org.springframework.boot.jackson.types.NameAndAge;
/**
@@ -29,7 +30,7 @@ import org.springframework.boot.jackson.types.NameAndAge;
*
* @author Paul Aly
*/
@JacksonComponent(type = NameAndAge.class, scope = JacksonComponent.Scope.KEYS)
@JacksonComponent(type = NameAndAge.class, scope = Scope.KEYS)
public class NameAndAgeJacksonKeyComponent {
static class Serializer extends ValueSerializer<NameAndAge> {
@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.function.Consumer;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.Test;
import tools.jackson.core.JsonGenerator;
@@ -251,7 +252,7 @@ class SpringBeanHandlerInstantiatorTests {
}
@JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, property = "type")
@JsonTypeInfo(use = Id.CUSTOM, property = "type")
@JsonTypeResolver(CustomTypeResolverBuilder.class)
@JsonTypeIdResolver(CustomTypeIdResolver.class)
public static class Group {
@@ -58,6 +58,7 @@ class JsonComponentModuleTests {
private @Nullable AnnotationConfigApplicationContext context;
@Deprecated(since = "4.0.0", forRemoval = true)
@AfterEach
void closeContext() {
if (this.context != null) {
@@ -65,6 +66,7 @@ class JsonComponentModuleTests {
}
}
@Deprecated(since = "4.0.0", forRemoval = true)
@Test
void moduleShouldRegisterSerializers() throws Exception {
load(OnlySerializer.class);
@@ -72,6 +74,7 @@ class JsonComponentModuleTests {
assertSerialize(module);
}
@Deprecated(since = "4.0.0", forRemoval = true)
@Test
void moduleShouldRegisterDeserializers() throws Exception {
load(OnlyDeserializer.class);
@@ -79,6 +82,7 @@ class JsonComponentModuleTests {
assertDeserialize(module);
}
@Deprecated(since = "4.0.0", forRemoval = true)
@Test
void moduleShouldRegisterInnerClasses() throws Exception {
load(NameAndAgeJsonComponent.class);
@@ -87,6 +91,7 @@ class JsonComponentModuleTests {
assertDeserialize(module);
}
@Deprecated(since = "4.0.0", forRemoval = true)
@Test
void moduleShouldAllowInnerAbstractClasses() throws Exception {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(JsonComponentModule.class,
@@ -96,6 +101,7 @@ class JsonComponentModuleTests {
context.close();
}
@Deprecated(since = "4.0.0", forRemoval = true)
@Test
void moduleShouldRegisterKeySerializers() throws Exception {
load(OnlyKeySerializer.class);
@@ -103,6 +109,7 @@ class JsonComponentModuleTests {
assertKeySerialize(module);
}
@Deprecated(since = "4.0.0", forRemoval = true)
@Test
void moduleShouldRegisterKeyDeserializers() throws Exception {
load(OnlyKeyDeserializer.class);
@@ -110,6 +117,7 @@ class JsonComponentModuleTests {
assertKeyDeserialize(module);
}
@Deprecated(since = "4.0.0", forRemoval = true)
@Test
void moduleShouldRegisterInnerClassesForKeyHandlers() throws Exception {
load(NameAndAgeJsonKeyComponent.class);
@@ -118,6 +126,7 @@ class JsonComponentModuleTests {
assertKeyDeserialize(module);
}
@Deprecated(since = "4.0.0", forRemoval = true)
@Test
void moduleShouldRegisterOnlyForSpecifiedClasses() throws Exception {
load(NameAndCareerJsonComponent.class);
@@ -127,6 +136,7 @@ class JsonComponentModuleTests {
assertDeserializeForSpecifiedClasses(module);
}
@Deprecated(since = "4.0.0", forRemoval = true)
@Test
void aotContributionRegistersReflectionHintsForSuitableInnerClasses() {
load(ComponentWithInnerAbstractClass.class);
@@ -214,39 +224,47 @@ class JsonComponentModuleTests {
return context;
}
@Deprecated(since = "4.0.0", forRemoval = true)
@JsonComponent
static class OnlySerializer extends NameAndAgeJsonComponent.Serializer {
}
@Deprecated(since = "4.0.0", forRemoval = true)
@JsonComponent
static class OnlyDeserializer extends NameAndAgeJsonComponent.Deserializer {
}
@Deprecated(since = "4.0.0", forRemoval = true)
@JsonComponent
static class ComponentWithInnerAbstractClass {
@Deprecated(since = "4.0.0", forRemoval = true)
abstract static class AbstractSerializer extends NameAndAgeJsonComponent.Serializer {
}
@Deprecated(since = "4.0.0", forRemoval = true)
static class ConcreteSerializer extends AbstractSerializer {
}
@Deprecated(since = "4.0.0", forRemoval = true)
static class NotSuitable {
}
}
@JsonComponent(scope = JsonComponent.Scope.KEYS)
@Deprecated(since = "4.0.0", forRemoval = true)
@JsonComponent(scope = org.springframework.boot.jackson2.JsonComponent.Scope.KEYS)
static class OnlyKeySerializer extends NameAndAgeJsonKeyComponent.Serializer {
}
@JsonComponent(scope = JsonComponent.Scope.KEYS, type = NameAndAge.class)
@Deprecated(since = "4.0.0", forRemoval = true)
@JsonComponent(scope = org.springframework.boot.jackson2.JsonComponent.Scope.KEYS, type = NameAndAge.class)
static class OnlyKeyDeserializer extends NameAndAgeJsonKeyComponent.Deserializer {
}
@@ -34,11 +34,13 @@ import org.springframework.boot.jackson2.types.NameAndAge;
*/
@Deprecated(since = "4.0.0", forRemoval = true)
@SuppressWarnings("removal")
@JsonComponent(type = NameAndAge.class, scope = JsonComponent.Scope.KEYS)
@JsonComponent(type = NameAndAge.class, scope = org.springframework.boot.jackson2.JsonComponent.Scope.KEYS)
public class NameAndAgeJsonKeyComponent {
@Deprecated(since = "4.0.0", forRemoval = true)
static class Serializer extends JsonSerializer<NameAndAge> {
@Deprecated(since = "4.0.0", forRemoval = true)
@Override
public void serialize(NameAndAge value, JsonGenerator jgen, SerializerProvider serializers) throws IOException {
jgen.writeFieldName(value.asKey());
@@ -46,8 +48,10 @@ public class NameAndAgeJsonKeyComponent {
}
@Deprecated(since = "4.0.0", forRemoval = true)
static class Deserializer extends KeyDeserializer {
@Deprecated(since = "4.0.0", forRemoval = true)
@Override
public NameAndAge deserializeKey(String key, DeserializationContext ctxt) throws IOException {
String[] keys = key.split("is");
@@ -23,6 +23,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.jdbc.EmbeddedDatabaseConnection;
import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase.Replace;
import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
@@ -34,8 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
*/
@JdbcTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.AUTO_CONFIGURED,
connection = EmbeddedDatabaseConnection.HSQLDB)
@AutoConfigureTestDatabase(replace = Replace.AUTO_CONFIGURED, connection = EmbeddedDatabaseConnection.HSQLDB)
class JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests {
@Autowired
@@ -21,6 +21,7 @@ import javax.sql.DataSource;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase.Replace;
import static org.assertj.core.api.Assertions.assertThat;
@@ -31,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
*/
@JdbcTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.AUTO_CONFIGURED)
@AutoConfigureTestDatabase(replace = Replace.AUTO_CONFIGURED)
class JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredWithoutOverrideIntegrationTests {
@Autowired
@@ -21,6 +21,7 @@ import javax.sql.DataSource;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase.Replace;
import static org.assertj.core.api.Assertions.assertThat;
@@ -31,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
*/
@JdbcTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@AutoConfigureTestDatabase(replace = Replace.NONE)
class JdbcTestWithAutoConfigureTestDatabaseReplaceNoneIntegrationTests {
@Autowired
@@ -58,7 +58,7 @@ public interface LiquibaseConnectionDetails extends ConnectionDetails {
* @see DatabaseDriver#fromJdbcUrl(String)
* @see DatabaseDriver#getDriverClassName()
*/
@Nullable default String getDriverClassName() {
default @Nullable String getDriverClassName() {
String jdbcUrl = getJdbcUrl();
return (jdbcUrl != null) ? DatabaseDriver.fromJdbcUrl(jdbcUrl).getDriverClassName() : null;
}
@@ -102,7 +102,6 @@ public abstract class AbstractRabbitListenerContainerFactoryConfigurer<T extends
/**
* Sets the observation convention to use.
* @param observationConvention the observation convention to use
* @since 4.2.0
*/
protected void setObservationConvention(@Nullable RabbitListenerObservationConvention observationConvention) {
this.observationConvention = observationConvention;
@@ -73,7 +73,6 @@ public class RabbitStreamTemplateConfigurer {
/**
* Set the observation convention to use.
* @param observationConvention the observation convention to use
* @since 4.2.0
*/
public void setObservationConvention(@Nullable RabbitStreamTemplateObservationConvention observationConvention) {
this.observationConvention = observationConvention;
@@ -87,7 +87,6 @@ public class RabbitTemplateConfigurer {
/**
* Sets the observation convention to use.
* @param observationConvention the observation convention to use
* @since 4.2.0
*/
public void setObservationConvention(@Nullable RabbitTemplateObservationConvention observationConvention) {
this.observationConvention = observationConvention;
@@ -170,7 +170,7 @@ public class Cookie {
*/
STRICT("Strict");
private @Nullable final String attributeValue;
private final @Nullable String attributeValue;
SameSite(@Nullable String attributeValue) {
this.attributeValue = attributeValue;
@@ -114,6 +114,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.EnumSource.Mode;
import org.mockito.InOrder;
import org.springframework.boot.ssl.DefaultSslBundleRegistry;
@@ -914,7 +915,7 @@ public abstract class AbstractServletWebServerFactoryTests {
}
@ParameterizedTest
@EnumSource(mode = EnumSource.Mode.EXCLUDE, names = "OMITTED")
@EnumSource(mode = Mode.EXCLUDE, names = "OMITTED")
void sessionCookieSameSiteAttributeCanBeConfiguredAndOnlyAffectsSessionCookies(SameSite sameSite) throws Exception {
ConfigurableServletWebServerFactory factory = getFactory();
factory.getSettings().getSession().getCookie().setSameSite(sameSite);
@@ -929,7 +930,7 @@ public abstract class AbstractServletWebServerFactoryTests {
}
@ParameterizedTest
@EnumSource(mode = EnumSource.Mode.EXCLUDE, names = "OMITTED")
@EnumSource(mode = Mode.EXCLUDE, names = "OMITTED")
void sessionCookieSameSiteAttributeCanBeConfiguredAndOnlyAffectsSessionCookiesWhenUsingCustomName(SameSite sameSite)
throws Exception {
ConfigurableServletWebServerFactory factory = getFactory();
@@ -21,6 +21,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.client.RestTestClient;
@@ -29,7 +30,7 @@ import org.springframework.test.web.servlet.client.RestTestClient;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@ActiveProfiles("cors")
@AutoConfigureRestTestClient
class CorsSampleActuatorApplicationTests {
@@ -18,6 +18,7 @@ package smoketest.actuator.customsecurity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.context.ApplicationContext;
@@ -26,8 +27,7 @@ import org.springframework.context.ApplicationContext;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = "spring.mvc.servlet.path=/example")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = "spring.mvc.servlet.path=/example")
class CustomServletPathSampleActuatorTests extends AbstractSampleActuatorCustomSecurityTests {
@LocalServerPort
@@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.context.ApplicationContext;
@@ -31,7 +32,7 @@ import org.springframework.test.web.servlet.client.RestTestClient;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.server.port=0", "spring.mvc.servlet.path=/example" })
class ManagementServerWithCustomServletPathSampleActuatorTests extends AbstractSampleActuatorCustomSecurityTests {
@@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.context.ApplicationContext;
import org.springframework.http.HttpStatus;
@@ -35,8 +36,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
* @author Scott Frederick
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = { "spring.web.error.include-message=always" })
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { "spring.web.error.include-message=always" })
class SampleActuatorCustomSecurityApplicationTests extends AbstractSampleActuatorCustomSecurityTests {
@LocalServerPort
@@ -21,6 +21,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.client.RestTestClient;
@@ -29,7 +30,7 @@ import org.springframework.test.web.servlet.client.RestTestClient;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@ActiveProfiles("cors")
@AutoConfigureRestTestClient
class CorsSampleActuatorApplicationTests {
@@ -19,6 +19,7 @@ package smoketest.actuator;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.http.HttpStatus;
import org.springframework.test.web.servlet.client.RestTestClient;
@@ -31,7 +32,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
*
* @author Guirong Hu
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.endpoints.web.exposure.include=*", "management.server.port=0" })
class ManagementDifferentPortAndEndpointWithExceptionHandlerSampleActuatorApplicationTests {
@@ -19,6 +19,7 @@ package smoketest.actuator;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.test.web.servlet.client.RestTestClient;
@@ -30,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author HaiTao Zhang
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.endpoints.web.base-path=/", "management.server.port=0" })
class ManagementDifferentPortSampleActuatorApplicationTests {
@@ -19,6 +19,7 @@ package smoketest.actuator;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.test.web.servlet.client.RestTestClient;
@@ -30,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.server.port=0", "spring.main.lazy-initialization=true" })
class ManagementPortWithLazyInitializationTests {
@@ -19,6 +19,7 @@ package smoketest.actuator;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.web.servlet.client.RestTestClient;
@@ -31,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Stephane Nicoll
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, args = "--management.server.port=1234")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, args = "--management.server.port=1234")
class ManagementRandomPortWithConfiguredPortSampleActuatorApplicationTests {
@LocalServerPort
@@ -23,6 +23,7 @@ import smoketest.jersey.AbstractJerseyManagementPortTests.ResourceConfigConfigur
import org.springframework.boot.jersey.autoconfigure.ResourceConfigCustomizer;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.boot.test.web.server.LocalServerPort;
@@ -41,7 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = "management.server.port=0")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = "management.server.port=0")
@Import(ResourceConfigConfiguration.class)
class AbstractJerseyManagementPortTests {
@@ -19,6 +19,7 @@ package smoketest.jersey;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.http.HttpStatus;
@@ -33,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.server.port=0", "spring.jersey.application-path=/app" })
class JerseyApplicationPathAndManagementPortTests {
@@ -19,6 +19,7 @@ package smoketest.jersey;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -32,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author HaiTao Zhang
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.server.port=0", "management.endpoints.web.base-path=/" })
class JerseyDifferentPortSampleActuatorApplicationTests {
@@ -27,6 +27,7 @@ import org.springframework.boot.http.client.HttpClientSettings;
import org.springframework.boot.http.client.HttpRedirects;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpStatus;
@@ -43,7 +44,7 @@ import org.springframework.util.MultiValueMap;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureRestTestClient
class SampleOAuth2AuthorizationServerApplicationTests {
@@ -24,12 +24,13 @@ import org.springframework.boot.http.client.HttpClientSettings;
import org.springframework.boot.http.client.HttpRedirects;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.web.servlet.client.RestTestClient;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "APP-CLIENT-ID=my-client-id", "APP-CLIENT-SECRET=my-client-secret",
"YAHOO-CLIENT-ID=my-yahoo-client-id", "YAHOO-CLIENT-SECRET=my-yahoo-client-secret" })
@AutoConfigureRestTestClient
@@ -27,11 +27,12 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.client.RestTestClient;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureRestTestClient
class SampleOauth2ResourceServerApplicationTests {
@@ -20,11 +20,12 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import static org.assertj.core.api.Assertions.assertThat;
// gh-29169
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class AttributeInjectionTests {
@Autowired(required = false)
@@ -20,12 +20,13 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
import org.springframework.test.web.reactive.server.WebTestClient;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "APP-CLIENT-ID=my-client-id", "APP-CLIENT-SECRET=my-client-secret",
"YAHOO-CLIENT-ID=my-google-client-id", "YAHOO-CLIENT-SECRET=my-google-client-secret" })
@AutoConfigureWebTestClient
@@ -24,12 +24,13 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.test.web.reactive.server.WebTestClient;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureWebTestClient
class SampleReactiveOAuth2ResourceServerApplicationTests {
@@ -24,12 +24,13 @@ import org.springframework.boot.http.client.HttpClientSettings;
import org.springframework.boot.http.client.HttpRedirects;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.web.servlet.client.RestTestClient;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureRestTestClient
class SampleSaml2RelyingPartyApplicationTests {
@@ -17,6 +17,7 @@
package smoketest.secure.jersey;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
/**
@@ -24,8 +25,7 @@ import org.springframework.boot.test.web.server.LocalServerPort;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = "spring.jersey.application-path=/example")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = "spring.jersey.application-path=/example")
class CustomApplicationPathActuatorTests extends AbstractJerseySecureTests {
@LocalServerPort
@@ -17,6 +17,7 @@
package smoketest.secure.jersey;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
/**
@@ -25,7 +26,7 @@ import org.springframework.boot.test.web.server.LocalServerPort;
* @author Madhura Bhave
* @author Stephane Nicoll
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class JerseySecureApplicationTests extends AbstractJerseySecureTests {
@LocalServerPort
@@ -19,6 +19,7 @@ package smoketest.secure.jersey;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.http.HttpStatus;
@@ -32,7 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.server.port=0", "spring.jersey.application-path=/example" })
class ManagementPortCustomApplicationPathJerseyTests extends AbstractJerseySecureTests {
@@ -20,6 +20,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.reactive.server.WebTestClient;
@@ -29,7 +30,7 @@ import org.springframework.test.web.reactive.server.WebTestClient;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@ActiveProfiles("cors")
@AutoConfigureWebTestClient
class CorsSampleActuatorApplicationTests {
@@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@@ -32,7 +33,7 @@ import org.springframework.test.web.reactive.server.WebTestClient;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = "management.endpoint.health.show-details=never")
@AutoConfigureWebTestClient
class SampleSecureWebFluxApplicationTests {
@@ -25,6 +25,7 @@ import org.springframework.boot.actuate.web.mappings.MappingsEndpoint;
import org.springframework.boot.security.autoconfigure.actuate.web.reactive.EndpointRequest;
import org.springframework.boot.security.autoconfigure.web.reactive.PathRequest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -43,7 +44,7 @@ import static org.springframework.security.config.Customizer.withDefaults;
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
classes = { SampleSecureWebFluxCustomSecurityTests.SecurityConfiguration.class,
SampleSecureWebFluxApplication.class })
@AutoConfigureWebTestClient
@@ -27,6 +27,7 @@ import reactor.util.function.Tuples;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.boot.testsupport.container.TestImage;
@@ -45,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Andy Wilkinson
* @author Phillip Webb
*/
@SpringBootTest(properties = "spring.session.timeout:10", webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(properties = "spring.session.timeout:10", webEnvironment = WebEnvironment.RANDOM_PORT)
@Testcontainers(disabledWithoutDocker = true)
class SampleSessionWebFluxRedisApplicationTests {
@@ -27,6 +27,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.boot.testsupport.container.TestImage;
import org.springframework.core.ParameterizedTypeReference;
@@ -46,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Andy Wilkinson
* @author Phillip Webb
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@Testcontainers(disabledWithoutDocker = true)
@AutoConfigureRestTestClient
class SampleSessionRedisApplicationTests {
@@ -30,6 +30,7 @@ import org.springframework.boot.http.client.HttpClientSettings;
import org.springframework.boot.http.client.HttpRedirects;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
@@ -51,7 +52,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Vedran Pavic
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "server.servlet.session.timeout:2", "debug=true" })
@AutoConfigureRestTestClient
class SampleSessionJdbcApplicationTests {
@@ -18,6 +18,7 @@ package smoketest.test.service;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import smoketest.test.domain.VehicleIdentificationNumber;
import org.springframework.beans.factory.annotation.Autowired;
@@ -45,7 +46,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
* @author Stephane Nicoll
*/
@RestClientTest
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@TestInstance(Lifecycle.PER_CLASS)
class RemoteVehicleDetailsServiceTests {
private static final String VIN = "00000000000000000";
@@ -17,13 +17,14 @@
package smoketest.web.secure;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
/**
* Tests for error page that permits access to all with a custom context path.
*
* @author Madhura Bhave
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
classes = { AbstractErrorPageTests.TestConfiguration.class,
UnauthenticatedErrorPageTests.SecurityConfiguration.class, SampleWebSecureApplication.class },
properties = { "spring.web.error.include-message=always", "spring.security.user.name=username",
@@ -17,6 +17,7 @@
package smoketest.web.secure;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.SecurityFilterChain;
@@ -28,10 +29,8 @@ import static org.springframework.security.config.Customizer.withDefaults;
*
* @author Andy Wilkinson
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
classes = { AbstractErrorPageTests.TestConfiguration.class,
CustomServletPathUnauthenticatedErrorPageTests.SecurityConfiguration.class,
SampleWebSecureApplication.class },
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = { AbstractErrorPageTests.TestConfiguration.class,
CustomServletPathUnauthenticatedErrorPageTests.SecurityConfiguration.class, SampleWebSecureApplication.class },
properties = { "spring.web.error.include-message=always", "spring.security.user.name=username",
"spring.security.user.password=password", "spring.mvc.servlet.path=/custom/servlet/path" })
class CustomServletPathUnauthenticatedErrorPageTests extends AbstractUnauthenticatedErrorPageTests {
@@ -19,6 +19,7 @@ package smoketest.webflux;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.test.web.reactive.server.WebTestClient;
@@ -30,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author HaiTao Zhang
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.server.port=0", "management.endpoints.web.base-path=/" })
class SampleWebFluxApplicationActuatorDifferentPortTests {
@@ -21,6 +21,7 @@ import tools.jackson.databind.json.JsonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
@@ -31,7 +32,7 @@ import org.springframework.test.web.reactive.server.WebTestClient;
*
* @author Phillip Webb
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.endpoints.jackson.isolated-json-mapper=false",
"spring.jackson.mapper.require-setters-for-getters=true" })
@ContextConfiguration(loader = ApplicationStartupSpringBootContextLoader.class)
@@ -23,6 +23,7 @@ import tools.jackson.databind.json.JsonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
@@ -36,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Phillip Webb
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
properties = { "management.endpoints.jackson.isolated-json-mapper=true",
"spring.jackson.mapper.require-setters-for-getters=true" })
@ContextConfiguration(loader = ApplicationStartupSpringBootContextLoader.class)