diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroups.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroups.java index f93303feccd..52024639dd7 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroups.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroups.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ class AvailabilityProbesHealthEndpointGroups implements HealthEndpointGroups { private static final String READINESS = "readiness"; AvailabilityProbesHealthEndpointGroups(HealthEndpointGroups groups, boolean addAdditionalPaths) { - Assert.notNull(groups, "Groups must not be null"); + Assert.notNull(groups, "'groups' must not be null"); this.groups = groups; this.probeGroups = createProbeGroups(addAdditionalPaths); Set names = new LinkedHashSet<>(groups.getNames()); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/availability/DelegatingAvailabilityProbesHealthEndpointGroup.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/availability/DelegatingAvailabilityProbesHealthEndpointGroup.java index 66975852e7c..daae8f4edf0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/availability/DelegatingAvailabilityProbesHealthEndpointGroup.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/availability/DelegatingAvailabilityProbesHealthEndpointGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ class DelegatingAvailabilityProbesHealthEndpointGroup implements HealthEndpointG DelegatingAvailabilityProbesHealthEndpointGroup(HealthEndpointGroup delegate, AdditionalHealthEndpointPath additionalPath) { - Assert.notNull(delegate, "Delegate must not be null"); + Assert.notNull(delegate, "'delegate' must not be null"); this.delegate = delegate; this.additionalPath = additionalPath; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java index 18ac9811b3d..e42d2e41428 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,8 +56,8 @@ class ReactiveCloudFoundrySecurityService { ReactiveCloudFoundrySecurityService(WebClient.Builder webClientBuilder, String cloudControllerUrl, boolean skipSslValidation) { - Assert.notNull(webClientBuilder, "WebClient must not be null"); - Assert.notNull(cloudControllerUrl, "CloudControllerUrl must not be null"); + Assert.notNull(webClientBuilder, "'webClientBuilder' must not be null"); + Assert.notNull(cloudControllerUrl, "'cloudControllerUrl' must not be null"); if (skipSslValidation) { webClientBuilder.clientConnector(buildTrustAllSslConnector()); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityService.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityService.java index 9be59775512..4a839437592 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityService.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityService.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,8 +49,8 @@ class CloudFoundrySecurityService { CloudFoundrySecurityService(RestTemplateBuilder restTemplateBuilder, String cloudControllerUrl, boolean skipSslValidation) { - Assert.notNull(restTemplateBuilder, "RestTemplateBuilder must not be null"); - Assert.notNull(cloudControllerUrl, "CloudControllerUrl must not be null"); + Assert.notNull(restTemplateBuilder, "'restTemplateBuilder' must not be null"); + Assert.notNull(cloudControllerUrl, "'cloudControllerUrl' must not be null"); if (skipSslValidation) { restTemplateBuilder = restTemplateBuilder.requestFactory(SkipSslVerificationHttpRequestFactory.class); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilter.java index 00affa4cfff..07b3dc1840e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,10 +80,10 @@ public class IncludeExcludeEndpointFilter> implem private IncludeExcludeEndpointFilter(Class endpointType, Environment environment, String prefix, EndpointPatterns defaultIncludes) { - Assert.notNull(endpointType, "EndpointType must not be null"); - Assert.notNull(environment, "Environment must not be null"); - Assert.hasText(prefix, "Prefix must not be empty"); - Assert.notNull(defaultIncludes, "DefaultIncludes must not be null"); + Assert.notNull(endpointType, "'endpointType' must not be null"); + Assert.notNull(environment, "'environment' must not be null"); + Assert.hasText(prefix, "'prefix' must not be empty"); + Assert.notNull(defaultIncludes, "'defaultIncludes' must not be null"); Binder binder = Binder.get(environment); this.endpointType = endpointType; this.include = new EndpointPatterns(bind(binder, prefix + ".include")); @@ -93,8 +93,8 @@ public class IncludeExcludeEndpointFilter> implem private IncludeExcludeEndpointFilter(Class endpointType, Collection include, Collection exclude, EndpointPatterns defaultIncludes) { - Assert.notNull(endpointType, "EndpointType Type must not be null"); - Assert.notNull(defaultIncludes, "DefaultIncludes must not be null"); + Assert.notNull(endpointType, "'endpointType' Type must not be null"); + Assert.notNull(defaultIncludes, "'defaultIncludes' must not be null"); this.endpointType = endpointType; this.include = new EndpointPatterns(include); this.defaultIncludes = defaultIncludes; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties.java index 06a9223eaf6..5201b917676 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ public class WebEndpointProperties { } public void setBasePath(String basePath) { - Assert.isTrue(basePath.isEmpty() || basePath.startsWith("/"), "Base path must start with '/' or be empty"); + Assert.isTrue(basePath.isEmpty() || basePath.startsWith("/"), "'basePath' must start with '/' or be empty"); this.basePath = cleanBasePath(basePath); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfiguration.java index 3b5aeda866d..9c590d64e7a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public abstract class AbstractCompositeHealthContributorConfiguration beans) { - Assert.notEmpty(beans, "Beans must not be empty"); + Assert.notEmpty(beans, "'beans' must not be empty"); if (beans.size() == 1) { return createIndicator(beans.values().iterator().next()); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfiguration.java index a94172671e9..a925ce1b5e0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,7 +97,7 @@ public class DataSourceHealthContributorAutoConfiguration implements Initializin } private HealthContributor createContributor(Map beans) { - Assert.notEmpty(beans, "Beans must not be empty"); + Assert.notEmpty(beans, "'beans' must not be empty"); if (beans.size() == 1) { return createContributor(beans.values().iterator().next()); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/OnlyOnceLoggingDenyMeterFilter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/OnlyOnceLoggingDenyMeterFilter.java index b257f66c4fb..51ba3251483 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/OnlyOnceLoggingDenyMeterFilter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/OnlyOnceLoggingDenyMeterFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public final class OnlyOnceLoggingDenyMeterFilter implements MeterFilter { private final Supplier message; public OnlyOnceLoggingDenyMeterFilter(Supplier message) { - Assert.notNull(message, "Message must not be null"); + Assert.notNull(message, "'message' must not be null"); this.message = message; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java index bf506756478..89db89f76aa 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class PropertiesMeterFilter implements MeterFilter { private final MeterFilter mapFilter; public PropertiesMeterFilter(MetricsProperties properties) { - Assert.notNull(properties, "Properties must not be null"); + Assert.notNull(properties, "'properties' must not be null"); this.properties = properties; this.mapFilter = createMapFilter(properties.getTags()); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/PropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/PropertiesConfigAdapter.java index 4cc34a98886..8b0371139aa 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/PropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/PropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ public class PropertiesConfigAdapter { * @param properties the source properties */ public PropertiesConfigAdapter(T properties) { - Assert.notNull(properties, "Properties must not be null"); + Assert.notNull(properties, "'properties' must not be null"); this.properties = properties; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthIndicatorProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthIndicatorProperties.java index f2b625463ad..1a98b24302a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthIndicatorProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthIndicatorProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ public class DiskSpaceHealthIndicatorProperties { } public void setThreshold(DataSize threshold) { - Assert.isTrue(!threshold.isNegative(), "threshold must be greater than or equal to 0"); + Assert.isTrue(!threshold.isNegative(), "'threshold' must be greater than or equal to 0"); this.threshold = threshold; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/LocalBaggageFields.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/LocalBaggageFields.java index dfd3f495ae7..aaf3311d696 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/LocalBaggageFields.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/LocalBaggageFields.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ class LocalBaggageFields { private final List fields; LocalBaggageFields(List fields) { - Assert.notNull(fields, "fields must not be null"); + Assert.notNull(fields, "'fields' must not be null"); this.fields = fields; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/SpanExporters.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/SpanExporters.java index a44f8ce0e03..1b7a5b18adc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/SpanExporters.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/SpanExporters.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ public interface SpanExporters extends Iterable { * @return the constructed {@link SpanExporters} instance */ static SpanExporters of(Collection spanExporters) { - Assert.notNull(spanExporters, "SpanExporters must not be null"); + Assert.notNull(spanExporters, "'spanExporters' must not be null"); List copy = List.copyOf(spanExporters); return () -> copy; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/SpanProcessors.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/SpanProcessors.java index ca8c55498d0..30cda9f7f74 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/SpanProcessors.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/SpanProcessors.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ public interface SpanProcessors extends Iterable { * @return the constructed {@link SpanProcessors} instance */ static SpanProcessors of(Collection spanProcessors) { - Assert.notNull(spanProcessors, "SpanProcessors must not be null"); + Assert.notNull(spanProcessors, "'spanProcessors' must not be null"); List copy = List.copyOf(spanProcessors); return () -> copy; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpoint.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpoint.java index 2759ca4d134..f4a814d47ec 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpoint.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,8 +47,8 @@ public class ManagementErrorEndpoint { private final ErrorProperties errorProperties; public ManagementErrorEndpoint(ErrorAttributes errorAttributes, ErrorProperties errorProperties) { - Assert.notNull(errorAttributes, "ErrorAttributes must not be null"); - Assert.notNull(errorProperties, "ErrorProperties must not be null"); + Assert.notNull(errorAttributes, "'errorAttributes' must not be null"); + Assert.notNull(errorProperties, "'errorProperties' must not be null"); this.errorAttributes = errorAttributes; this.errorProperties = errorProperties; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupsTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupsTests.java index ae5dfc53845..caae873f31a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupsTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/availability/AvailabilityProbesHealthEndpointGroupsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ class AvailabilityProbesHealthEndpointGroupsTests { @Test void createWhenGroupsIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new AvailabilityProbesHealthEndpointGroups(null, false)) - .withMessage("Groups must not be null"); + .withMessage("'groups' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java index 75737180e4a..a8e1a0df42c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,28 +45,28 @@ class IncludeExcludeEndpointFilterTests { void createWhenEndpointTypeIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new IncludeExcludeEndpointFilter<>(null, new MockEnvironment(), "foo")) - .withMessageContaining("EndpointType must not be null"); + .withMessageContaining("'endpointType' must not be null"); } @Test void createWhenEnvironmentIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, null, "foo")) - .withMessageContaining("Environment must not be null"); + .withMessageContaining("'environment' must not be null"); } @Test void createWhenPrefixIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), null)) - .withMessageContaining("Prefix must not be empty"); + .withMessageContaining("'prefix' must not be empty"); } @Test void createWhenPrefixIsEmptyShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), "")) - .withMessageContaining("Prefix must not be empty"); + .withMessageContaining("'prefix' must not be empty"); } @Test diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointPropertiesTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointPropertiesTests.java index 441d15bf664..318057ac2d2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointPropertiesTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ class WebEndpointPropertiesTests { void basePathMustStartWithSlash() { WebEndpointProperties properties = new WebEndpointProperties(); assertThatIllegalArgumentException().isThrownBy(() -> properties.setBasePath("admin")) - .withMessageContaining("Base path must start with '/' or be empty"); + .withMessageContaining("'basePath' must start with '/' or be empty"); } @Test diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfigurationTests.java index e769d93ef3c..3cc279899ec 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ abstract class AbstractCompositeHealthContributorConfigurationTests beans = Collections.emptyMap(); assertThatIllegalArgumentException().isThrownBy(() -> newComposite().createContributor(beans)) - .withMessage("Beans must not be empty"); + .withMessage("'beans' must not be empty"); } @Test diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java index e1db8683bb4..1437d65e7c5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ class PropertiesMeterFilterTests { @Test void createWhenPropertiesIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new PropertiesMeterFilter(null)) - .withMessageContaining("Properties must not be null"); + .withMessageContaining("'properties' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthContributorAutoConfigurationTests.java index 20b28b81b61..18675cfbb12 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthContributorAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ class DiskSpaceHealthContributorAutoConfigurationTests { .run((context) -> assertThat(context).hasFailed() .getFailure() .rootCause() - .hasMessage("threshold must be greater than or equal to 0")); + .hasMessage("'threshold' must be greater than or equal to 0")); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/amqp/RabbitHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/amqp/RabbitHealthIndicator.java index 386da31a9bc..e4861b0bcc4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/amqp/RabbitHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/amqp/RabbitHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ public class RabbitHealthIndicator extends AbstractHealthIndicator { public RabbitHealthIndicator(RabbitTemplate rabbitTemplate) { super("Rabbit health check failed"); - Assert.notNull(rabbitTemplate, "RabbitTemplate must not be null"); + Assert.notNull(rabbitTemplate, "'rabbitTemplate' must not be null"); this.rabbitTemplate = rabbitTemplate; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEvent.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEvent.java index e943f2d137a..2fd00f99e25 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEvent.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,8 +83,8 @@ public class AuditEvent implements Serializable { * @param data the event data */ public AuditEvent(Instant timestamp, String principal, String type, Map data) { - Assert.notNull(timestamp, "Timestamp must not be null"); - Assert.notNull(type, "Type must not be null"); + Assert.notNull(timestamp, "'timestamp' must not be null"); + Assert.notNull(type, "'type' must not be null"); this.timestamp = timestamp; this.principal = (principal != null) ? principal : ""; this.type = type; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventsEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventsEndpoint.java index 57a2f1f0cfd..cf001c1d44f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventsEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventsEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ public class AuditEventsEndpoint { private final AuditEventRepository auditEventRepository; public AuditEventsEndpoint(AuditEventRepository auditEventRepository) { - Assert.notNull(auditEventRepository, "AuditEventRepository must not be null"); + Assert.notNull(auditEventRepository, "'auditEventRepository' must not be null"); this.auditEventRepository = auditEventRepository; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepository.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepository.java index 06433c621e4..668cd207463 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepository.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ public class InMemoryAuditEventRepository implements AuditEventRepository { @Override public void add(AuditEvent event) { - Assert.notNull(event, "AuditEvent must not be null"); + Assert.notNull(event, "'event' must not be null"); synchronized (this.monitor) { this.tail = (this.tail + 1) % this.events.length; this.events[this.tail] = event; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/listener/AuditApplicationEvent.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/listener/AuditApplicationEvent.java index dd0e6f42f33..f9fc139a80c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/listener/AuditApplicationEvent.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/listener/AuditApplicationEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ public class AuditApplicationEvent extends ApplicationEvent { */ public AuditApplicationEvent(AuditEvent auditEvent) { super(auditEvent); - Assert.notNull(auditEvent, "AuditEvent must not be null"); + Assert.notNull(auditEvent, "'auditEvent' must not be null"); this.auditEvent = auditEvent; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicator.java index e1b73a24101..34132169246 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicator.java @@ -55,9 +55,9 @@ public class AvailabilityStateHealthIndicator extends AbstractHealthIndicator { public AvailabilityStateHealthIndicator( ApplicationAvailability applicationAvailability, Class stateType, Consumer> statusMappings) { - Assert.notNull(applicationAvailability, "ApplicationAvailability must not be null"); - Assert.notNull(stateType, "StateType must not be null"); - Assert.notNull(statusMappings, "StatusMappings must not be null"); + Assert.notNull(applicationAvailability, "'applicationAvailability' must not be null"); + Assert.notNull(stateType, "'stateType' must not be null"); + Assert.notNull(statusMappings, "'statusMappings' must not be null"); this.applicationAvailability = applicationAvailability; this.stateType = stateType; statusMappings.accept(this.statusMappings::put); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraDriverHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraDriverHealthIndicator.java index ed42a0bbda6..c43e35f2739 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraDriverHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraDriverHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public class CassandraDriverHealthIndicator extends AbstractHealthIndicator { */ public CassandraDriverHealthIndicator(CqlSession session) { super("Cassandra health check failed"); - Assert.notNull(session, "session must not be null"); + Assert.notNull(session, "'session' must not be null"); this.session = session; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraDriverReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraDriverReactiveHealthIndicator.java index 646560d0788..eab8119ed9f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraDriverReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraDriverReactiveHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public class CassandraDriverReactiveHealthIndicator extends AbstractReactiveHeal */ public CassandraDriverReactiveHealthIndicator(CqlSession session) { super("Cassandra health check failed"); - Assert.notNull(session, "session must not be null"); + Assert.notNull(session, "'session' must not be null"); this.session = session; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicator.java index cefa92cc542..3529270eb3a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/couchbase/CouchbaseHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ public class CouchbaseHealthIndicator extends AbstractHealthIndicator { */ public CouchbaseHealthIndicator(Cluster cluster) { super("Couchbase health check failed"); - Assert.notNull(cluster, "Cluster must not be null"); + Assert.notNull(cluster, "'cluster' must not be null"); this.cluster = cluster; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoReactiveHealthIndicator.java index 39a3b6bb142..9b5dd830400 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoReactiveHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public class MongoReactiveHealthIndicator extends AbstractReactiveHealthIndicato public MongoReactiveHealthIndicator(ReactiveMongoTemplate reactiveMongoTemplate) { super("Mongo health check failed"); - Assert.notNull(reactiveMongoTemplate, "ReactiveMongoTemplate must not be null"); + Assert.notNull(reactiveMongoTemplate, "'reactiveMongoTemplate' must not be null"); this.reactiveMongoTemplate = reactiveMongoTemplate; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java index eaa3fbab86d..69bd0727141 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ public class RedisHealthIndicator extends AbstractHealthIndicator { public RedisHealthIndicator(RedisConnectionFactory connectionFactory) { super("Redis health check failed"); - Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); + Assert.notNull(connectionFactory, "'connectionFactory' must not be null"); this.redisConnectionFactory = connectionFactory; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractExposableEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractExposableEndpoint.java index 96108afa538..8817fd94dca 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractExposableEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractExposableEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,8 +57,8 @@ public abstract class AbstractExposableEndpoint implements * @since 3.4.0 */ public AbstractExposableEndpoint(EndpointId id, Access defaultAccess, Collection operations) { - Assert.notNull(id, "ID must not be null"); - Assert.notNull(operations, "Operations must not be null"); + Assert.notNull(id, "'id' must not be null"); + Assert.notNull(operations, "'operations' must not be null"); this.id = id; this.defaultAccess = defaultAccess; this.operations = List.copyOf(operations); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Access.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Access.java index c810d540b20..416f28d3c0e 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Access.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Access.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public enum Access { * @return this access if less than the maximum or the maximum permitted */ public Access cap(Access maxPermitted) { - Assert.notNull(maxPermitted, "'maxPermittedAccess' must not be null"); + Assert.notNull(maxPermitted, "'maxPermitted' must not be null"); return (ordinal() <= maxPermitted.ordinal()) ? this : maxPermitted; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EndpointId.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EndpointId.java index 269ca381aca..a9e33ea6511 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EndpointId.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/EndpointId.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,10 +54,10 @@ public final class EndpointId { private final String lowerCaseAlphaNumeric; private EndpointId(String value) { - Assert.hasText(value, "Value must not be empty"); - Assert.isTrue(VALID_PATTERN.matcher(value).matches(), "Value must only contain valid chars"); - Assert.isTrue(!Character.isDigit(value.charAt(0)), "Value must not start with a number"); - Assert.isTrue(!Character.isUpperCase(value.charAt(0)), "Value must not start with an uppercase letter"); + Assert.hasText(value, "'value' must not be empty"); + Assert.isTrue(VALID_PATTERN.matcher(value).matches(), "'value' must only contain valid chars"); + Assert.isTrue(!Character.isDigit(value.charAt(0)), "'value' must not start with a number"); + Assert.isTrue(!Character.isUpperCase(value.charAt(0)), "'value' must not start with an uppercase letter"); if (WARNING_PATTERN.matcher(value).find()) { logWarning(value); } @@ -125,7 +125,7 @@ public final class EndpointId { * @since 2.2.0 */ public static EndpointId of(Environment environment, String value) { - Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(environment, "'environment' must not be null"); return new EndpointId(migrateLegacyId(environment, value)); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/InvocationContext.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/InvocationContext.java index 3369570c391..e1853cf9c8d 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/InvocationContext.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/InvocationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,8 +48,8 @@ public class InvocationContext { */ public InvocationContext(SecurityContext securityContext, Map arguments, OperationArgumentResolver... argumentResolvers) { - Assert.notNull(securityContext, "SecurityContext must not be null"); - Assert.notNull(arguments, "Arguments must not be null"); + Assert.notNull(securityContext, "'securityContext' must not be null"); + Assert.notNull(arguments, "'arguments' must not be null"); this.arguments = arguments; this.argumentResolvers = new ArrayList<>(); if (argumentResolvers != null) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/OperationArgumentResolver.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/OperationArgumentResolver.java index 9ade2ec523d..539f92fa5e0 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/OperationArgumentResolver.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/OperationArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,8 +53,8 @@ public interface OperationArgumentResolver { * @return an {@link OperationArgumentResolver} instance */ static OperationArgumentResolver of(Class type, Supplier supplier) { - Assert.notNull(type, "Type must not be null"); - Assert.notNull(supplier, "Supplier must not be null"); + Assert.notNull(type, "'type' must not be null"); + Assert.notNull(supplier, "'supplier' must not be null"); return new OperationArgumentResolver() { @Override diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java index 72a58181033..0d61efd8439 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,8 +70,8 @@ public abstract class AbstractDiscoveredEndpoint extends Ab public AbstractDiscoveredEndpoint(EndpointDiscoverer discoverer, Object endpointBean, EndpointId id, Access defaultAccess, Collection operations) { super(id, defaultAccess, operations); - Assert.notNull(discoverer, "Discoverer must not be null"); - Assert.notNull(endpointBean, "EndpointBean must not be null"); + Assert.notNull(discoverer, "'discoverer' must not be null"); + Assert.notNull(endpointBean, "'endpointBean' must not be null"); this.discoverer = discoverer; this.endpointBean = endpointBean; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/DiscoveredOperationMethod.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/DiscoveredOperationMethod.java index 4cf89333a90..e72059365c1 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/DiscoveredOperationMethod.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/DiscoveredOperationMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ public class DiscoveredOperationMethod extends OperationMethod { public DiscoveredOperationMethod(Method method, OperationType operationType, AnnotationAttributes annotationAttributes) { super(method, operationType); - Assert.notNull(annotationAttributes, "AnnotationAttributes must not be null"); + Assert.notNull(annotationAttributes, "'annotationAttributes' must not be null"); List producesMediaTypes = new ArrayList<>(); producesMediaTypes.addAll(Arrays.asList(annotationAttributes.getStringArray("produces"))); producesMediaTypes.addAll(getProducesFromProducible(annotationAttributes)); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/DiscovererEndpointFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/DiscovererEndpointFilter.java index 45c0354b880..154051a8149 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/DiscovererEndpointFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/DiscovererEndpointFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ public abstract class DiscovererEndpointFilter implements EndpointFilter> discoverer) { - Assert.notNull(discoverer, "Discoverer must not be null"); + Assert.notNull(discoverer, "'discoverer' must not be null"); this.discoverer = discoverer; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java index d28113bbb26..0111225dc36 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,11 +111,11 @@ public abstract class EndpointDiscoverer, O exten public EndpointDiscoverer(ApplicationContext applicationContext, ParameterValueMapper parameterValueMapper, Collection invokerAdvisors, Collection> endpointFilters, Collection> operationFilters) { - Assert.notNull(applicationContext, "ApplicationContext must not be null"); - Assert.notNull(parameterValueMapper, "ParameterValueMapper must not be null"); - Assert.notNull(invokerAdvisors, "InvokerAdvisors must not be null"); - Assert.notNull(endpointFilters, "EndpointFilters must not be null"); - Assert.notNull(operationFilters, "OperationFilters must not be null"); + Assert.notNull(applicationContext, "'applicationContext' must not be null"); + Assert.notNull(parameterValueMapper, "'parameterValueMapper' must not be null"); + Assert.notNull(invokerAdvisors, "'invokerAdvisors' must not be null"); + Assert.notNull(endpointFilters, "'endpointFilters' must not be null"); + Assert.notNull(operationFilters, "'operationFilters' must not be null"); this.applicationContext = applicationContext; this.endpointFilters = Collections.unmodifiableCollection(endpointFilters); this.operationFilters = Collections.unmodifiableCollection(operationFilters); @@ -440,8 +440,8 @@ public abstract class EndpointDiscoverer, O exten * @param description a human-readable description of the key */ public OperationKey(Object key, Supplier description) { - Assert.notNull(key, "Key must not be null"); - Assert.notNull(description, "Description must not be null"); + Assert.notNull(key, "'key' must not be null"); + Assert.notNull(description, "'description' must not be null"); this.key = key; this.description = description; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/convert/ConversionServiceParameterValueMapper.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/convert/ConversionServiceParameterValueMapper.java index 3d185879ed5..666b00ea2c2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/convert/ConversionServiceParameterValueMapper.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/convert/ConversionServiceParameterValueMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public class ConversionServiceParameterValueMapper implements ParameterValueMapp * @param conversionService the conversion service */ public ConversionServiceParameterValueMapper(ConversionService conversionService) { - Assert.notNull(conversionService, "ConversionService must not be null"); + Assert.notNull(conversionService, "'conversionService' must not be null"); this.conversionService = conversionService; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethod.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethod.java index 242de67e743..441b4334c99 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethod.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,8 +48,8 @@ public class OperationMethod { * @param operationType the operation type */ public OperationMethod(Method method, OperationType operationType) { - Assert.notNull(method, "Method must not be null"); - Assert.notNull(operationType, "OperationType must not be null"); + Assert.notNull(method, "'method' must not be null"); + Assert.notNull(operationType, "'operationType' must not be null"); this.method = method; this.operationType = operationType; this.operationParameters = new OperationMethodParameters(method, DEFAULT_PARAMETER_NAME_DISCOVERER); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameters.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameters.java index d81826a8603..171b8ffb516 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameters.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,8 +44,8 @@ class OperationMethodParameters implements OperationParameters { * @param parameterNameDiscoverer the parameter name discoverer */ OperationMethodParameters(Method method, ParameterNameDiscoverer parameterNameDiscoverer) { - Assert.notNull(method, "Method must not be null"); - Assert.notNull(parameterNameDiscoverer, "ParameterNameDiscoverer must not be null"); + Assert.notNull(method, "'method' must not be null"); + Assert.notNull(parameterNameDiscoverer, "'parameterNameDiscoverer' must not be null"); String[] parameterNames = parameterNameDiscoverer.getParameterNames(method); Parameter[] parameters = method.getParameters(); Assert.state(parameterNames != null, () -> "Failed to extract parameter names for " + method); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvoker.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvoker.java index 7f8f3960b4f..505a2e2f852 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvoker.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,9 +56,9 @@ public class ReflectiveOperationInvoker implements OperationInvoker { */ public ReflectiveOperationInvoker(Object target, OperationMethod operationMethod, ParameterValueMapper parameterValueMapper) { - Assert.notNull(target, "Target must not be null"); - Assert.notNull(operationMethod, "OperationMethod must not be null"); - Assert.notNull(parameterValueMapper, "ParameterValueMapper must not be null"); + Assert.notNull(target, "'target' must not be null"); + Assert.notNull(operationMethod, "'operationMethod' must not be null"); + Assert.notNull(parameterValueMapper, "'parameterValueMapper' must not be null"); ReflectionUtils.makeAccessible(operationMethod.getMethod()); this.target = target; this.operationMethod = operationMethod; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvoker.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvoker.java index 8cd51645de9..df24c8e0c34 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvoker.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,7 +65,7 @@ public class CachingOperationInvoker implements OperationInvoker { * @param timeToLive the maximum time in milliseconds that a response can be cached */ CachingOperationInvoker(OperationInvoker invoker, long timeToLive) { - Assert.isTrue(timeToLive > 0, "TimeToLive must be strictly positive"); + Assert.isTrue(timeToLive > 0, "'timeToLive' must be greater than zero"); this.invoker = invoker; this.timeToLive = timeToLive; this.cachedResponses = new ConcurrentReferenceHashMap<>(); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java index 845e9707c7e..1bb56a0ddb2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,8 +63,8 @@ public class EndpointMBean implements DynamicMBean { private final Map operations; EndpointMBean(JmxOperationResponseMapper responseMapper, ClassLoader classLoader, ExposableJmxEndpoint endpoint) { - Assert.notNull(responseMapper, "ResponseMapper must not be null"); - Assert.notNull(endpoint, "Endpoint must not be null"); + Assert.notNull(responseMapper, "'responseMapper' must not be null"); + Assert.notNull(endpoint, "'endpoint' must not be null"); this.responseMapper = responseMapper; this.classLoader = classLoader; this.endpoint = endpoint; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporter.java index 7c7f147db52..b0c0e7d5cdd 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,10 +61,10 @@ public class JmxEndpointExporter implements InitializingBean, DisposableBean, Be public JmxEndpointExporter(MBeanServer mBeanServer, EndpointObjectNameFactory objectNameFactory, JmxOperationResponseMapper responseMapper, Collection endpoints) { - Assert.notNull(mBeanServer, "MBeanServer must not be null"); - Assert.notNull(objectNameFactory, "ObjectNameFactory must not be null"); - Assert.notNull(responseMapper, "ResponseMapper must not be null"); - Assert.notNull(endpoints, "Endpoints must not be null"); + Assert.notNull(mBeanServer, "'mBeanServer' must not be null"); + Assert.notNull(objectNameFactory, "'objectNameFactory' must not be null"); + Assert.notNull(responseMapper, "'responseMapper' must not be null"); + Assert.notNull(endpoints, "'endpoints' must not be null"); this.mBeanServer = mBeanServer; this.objectNameFactory = objectNameFactory; this.responseMapper = responseMapper; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMediaTypes.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMediaTypes.java index b46accae753..58be89d54fc 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMediaTypes.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMediaTypes.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,8 +72,8 @@ public class EndpointMediaTypes { * @param consumed the default media types that are consumed by an endpoint. Must not */ public EndpointMediaTypes(List produced, List consumed) { - Assert.notNull(produced, "Produced must not be null"); - Assert.notNull(consumed, "Consumed must not be null"); + Assert.notNull(produced, "'produced' must not be null"); + Assert.notNull(consumed, "'consumed' must not be null"); this.produced = Collections.unmodifiableList(produced); this.consumed = Collections.unmodifiableList(consumed); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java index 6f7b9e83ae1..a419c1e827c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ public final class EndpointServlet { } private static Servlet instantiateClass(Class servlet) { - Assert.notNull(servlet, "Servlet must not be null"); + Assert.notNull(servlet, "'servlet' must not be null"); return BeanUtils.instantiateClass(servlet); } @@ -58,21 +58,21 @@ public final class EndpointServlet { } private EndpointServlet(Servlet servlet, Map initParameters, int loadOnStartup) { - Assert.notNull(servlet, "Servlet must not be null"); + Assert.notNull(servlet, "'servlet' must not be null"); this.servlet = servlet; this.initParameters = Collections.unmodifiableMap(initParameters); this.loadOnStartup = loadOnStartup; } public EndpointServlet withInitParameter(String name, String value) { - Assert.hasText(name, "Name must not be empty"); + Assert.hasText(name, "'name' must not be empty"); return withInitParameters(Collections.singletonMap(name, value)); } public EndpointServlet withInitParameters(Map initParameters) { - Assert.notNull(initParameters, "InitParameters must not be null"); + Assert.notNull(initParameters, "'initParameters' must not be null"); boolean hasEmptyName = initParameters.keySet().stream().anyMatch((name) -> !StringUtils.hasText(name)); - Assert.isTrue(!hasEmptyName, "InitParameters must not contain empty names"); + Assert.isTrue(!hasEmptyName, "'initParameters' must not contain empty names"); Map mergedInitParameters = new LinkedHashMap<>(this.initParameters); mergedInitParameters.putAll(initParameters); return new EndpointServlet(this.servlet, mergedInitParameters, this.loadOnStartup); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/Link.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/Link.java index f0e1b9bcb36..86b84dec0dd 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/Link.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/Link.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ public class Link { * @param href the href */ public Link(String href) { - Assert.notNull(href, "HREF must not be null"); + Assert.notNull(href, "'href' must not be null"); this.href = href; this.templated = href.contains("{"); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpoints.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpoints.java index 96995b2e0da..aa1946124ac 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpoints.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpoints.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public class PathMappedEndpoints implements Iterable { * @param supplier the endpoint supplier */ public PathMappedEndpoints(String basePath, EndpointsSupplier supplier) { - Assert.notNull(supplier, "Supplier must not be null"); + Assert.notNull(supplier, "'supplier' must not be null"); this.basePath = (basePath != null) ? basePath : ""; this.endpoints = getEndpoints(Collections.singleton(supplier)); } @@ -58,7 +58,7 @@ public class PathMappedEndpoints implements Iterable { * @param suppliers the endpoint suppliers */ public PathMappedEndpoints(String basePath, Collection> suppliers) { - Assert.notNull(suppliers, "Suppliers must not be null"); + Assert.notNull(suppliers, "'suppliers' must not be null"); this.basePath = (basePath != null) ? basePath : ""; this.endpoints = getEndpoints(suppliers); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMapper.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMapper.java index ba59d987cf3..52639110ca2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMapper.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ public interface PathMapper { * @return the path of the endpoint */ static String getRootPath(List pathMappers, EndpointId endpointId) { - Assert.notNull(endpointId, "EndpointId must not be null"); + Assert.notNull(endpointId, "'endpointId' must not be null"); if (pathMappers != null) { for (PathMapper mapper : pathMappers) { String path = mapper.getRootPath(endpointId); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java index 13508e7c87b..3c82519d1c3 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ public class ServletEndpointRegistrar implements ServletContextInitializer { public ServletEndpointRegistrar(String basePath, Collection servletEndpoints, EndpointAccessResolver endpointAccessResolver) { - Assert.notNull(servletEndpoints, "ServletEndpoints must not be null"); + Assert.notNull(servletEndpoints, "'servletEndpoints' must not be null"); this.basePath = cleanBasePath(basePath); this.servletEndpoints = servletEndpoints; this.endpointAccessResolver = endpointAccessResolver; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java index 1f9557bc8e0..adcd4d52844 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ class RequestPredicateFactory { private final EndpointMediaTypes endpointMediaTypes; RequestPredicateFactory(EndpointMediaTypes endpointMediaTypes) { - Assert.notNull(endpointMediaTypes, "EndpointMediaTypes must not be null"); + Assert.notNull(endpointMediaTypes, "'endpointMediaTypes' must not be null"); this.endpointMediaTypes = endpointMediaTypes; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMapping.java index 8591199e0b1..a2f2d5142c8 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,8 +87,8 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi public ControllerEndpointHandlerMapping(EndpointMapping endpointMapping, Collection endpoints, CorsConfiguration corsConfiguration, EndpointAccessResolver endpointAccessResolver) { - Assert.notNull(endpointMapping, "EndpointMapping must not be null"); - Assert.notNull(endpoints, "Endpoints must not be null"); + Assert.notNull(endpointMapping, "'endpointMapping' must not be null"); + Assert.notNull(endpoints, "'endpoints' must not be null"); this.endpointMapping = endpointMapping; this.handlers = getHandlers(endpoints); this.corsConfiguration = corsConfiguration; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java index b7085b91717..267614cdf7d 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,8 +88,8 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi public ControllerEndpointHandlerMapping(EndpointMapping endpointMapping, Collection endpoints, CorsConfiguration corsConfiguration, EndpointAccessResolver endpointAccessResolver) { - Assert.notNull(endpointMapping, "EndpointMapping must not be null"); - Assert.notNull(endpoints, "Endpoints must not be null"); + Assert.notNull(endpointMapping, "'endpointMapping' must not be null"); + Assert.notNull(endpoints, "'endpoints' must not be null"); this.endpointMapping = endpointMapping; this.handlers = getHandlers(endpoints); this.corsConfiguration = corsConfiguration; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicator.java index d28b82a8e7d..694ebec52a9 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ public class HazelcastHealthIndicator extends AbstractHealthIndicator { public HazelcastHealthIndicator(HazelcastInstance hazelcast) { super("Hazelcast health check failed"); - Assert.notNull(hazelcast, "HazelcastInstance must not be null"); + Assert.notNull(hazelcast, "'hazelcast' must not be null"); this.hazelcast = hazelcast; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractHealthIndicator.java index ebf13309c9e..a89f26f8b2a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ public abstract class AbstractHealthIndicator implements HealthIndicator { * @since 2.0.0 */ protected AbstractHealthIndicator(Function healthCheckFailedMessage) { - Assert.notNull(healthCheckFailedMessage, "HealthCheckFailedMessage must not be null"); + Assert.notNull(healthCheckFailedMessage, "'healthCheckFailedMessage' must not be null"); this.healthCheckFailedMessage = healthCheckFailedMessage; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractReactiveHealthIndicator.java index 0b6e2c79269..81ffd0a3234 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AbstractReactiveHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ public abstract class AbstractReactiveHealthIndicator implements ReactiveHealthI * @since 2.1.7 */ protected AbstractReactiveHealthIndicator(Function healthCheckFailedMessage) { - Assert.notNull(healthCheckFailedMessage, "HealthCheckFailedMessage must not be null"); + Assert.notNull(healthCheckFailedMessage, "'healthCheckFailedMessage' must not be null"); this.healthCheckFailedMessage = healthCheckFailedMessage; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AdditionalHealthEndpointPath.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AdditionalHealthEndpointPath.java index 2b3cccd0969..2ac395be505 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AdditionalHealthEndpointPath.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AdditionalHealthEndpointPath.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,10 +103,10 @@ public final class AdditionalHealthEndpointPath { * @return the new instance */ public static AdditionalHealthEndpointPath from(String value) { - Assert.hasText(value, "Value must not be null"); + Assert.hasText(value, "'value' must not be null"); String[] values = value.split(":"); - Assert.isTrue(values.length == 2, "Value must contain a valid namespace and value separated by ':'."); - Assert.isTrue(StringUtils.hasText(values[0]), "Value must contain a valid namespace."); + Assert.isTrue(values.length == 2, "'value' must contain a valid namespace and value separated by ':'."); + Assert.isTrue(StringUtils.hasText(values[0]), "'value' must contain a valid namespace."); WebServerNamespace namespace = WebServerNamespace.from(values[0]); validateValue(values[1]); return new AdditionalHealthEndpointPath(namespace, values[1]); @@ -120,15 +120,15 @@ public final class AdditionalHealthEndpointPath { * @return the new instance */ public static AdditionalHealthEndpointPath of(WebServerNamespace webServerNamespace, String value) { - Assert.notNull(webServerNamespace, "The server namespace must not be null."); - Assert.notNull(value, "The value must not be null."); + Assert.notNull(webServerNamespace, "'webServerNamespace' must not be null."); + Assert.notNull(value, "'value' must not be null."); validateValue(value); return new AdditionalHealthEndpointPath(webServerNamespace, value); } private static void validateValue(String value) { Assert.isTrue(StringUtils.countOccurrencesOf(value, "/") <= 1 && value.indexOf("/") <= 0, - "Value must contain only one segment."); + "'value' must contain only one segment."); } } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealth.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealth.java index 6f1a8b7c247..94e808aae59 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealth.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealth.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ public class CompositeHealth extends HealthComponent { private final Map details; CompositeHealth(ApiVersion apiVersion, Status status, Map components) { - Assert.notNull(status, "Status must not be null"); + Assert.notNull(status, "'status' must not be null"); this.status = status; this.components = (apiVersion != ApiVersion.V3) ? null : sort(components); this.details = (apiVersion != ApiVersion.V2) ? null : sort(components); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapter.java index 41dace35eec..4cb6560332d 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ class CompositeHealthContributorReactiveAdapter implements CompositeReactiveHeal private final CompositeHealthContributor delegate; CompositeHealthContributorReactiveAdapter(CompositeHealthContributor delegate) { - Assert.notNull(delegate, "Delegate must not be null"); + Assert.notNull(delegate, "'delegate' must not be null"); this.delegate = delegate; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DefaultContributorRegistry.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DefaultContributorRegistry.java index faae11ae445..7e209c2ce07 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DefaultContributorRegistry.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DefaultContributorRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,8 +50,8 @@ class DefaultContributorRegistry implements ContributorRegistry { } DefaultContributorRegistry(Map contributors, Function nameFactory) { - Assert.notNull(contributors, "Contributors must not be null"); - Assert.notNull(nameFactory, "NameFactory must not be null"); + Assert.notNull(contributors, "'contributors' must not be null"); + Assert.notNull(nameFactory, "'nameFactory' must not be null"); this.nameFactory = nameFactory; Map namedContributors = new LinkedHashMap<>(); contributors.forEach((name, contributor) -> namedContributors.put(nameFactory.apply(name), contributor)); @@ -60,8 +60,8 @@ class DefaultContributorRegistry implements ContributorRegistry { @Override public void registerContributor(String name, C contributor) { - Assert.notNull(name, "Name must not be null"); - Assert.notNull(contributor, "Contributor must not be null"); + Assert.notNull(name, "'name' must not be null"); + Assert.notNull(contributor, "'contributor' must not be null"); String adaptedName = this.nameFactory.apply(name); synchronized (this.monitor) { Assert.state(!this.contributors.containsKey(adaptedName), @@ -74,7 +74,7 @@ class DefaultContributorRegistry implements ContributorRegistry { @Override public C unregisterContributor(String name) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); String adaptedName = this.nameFactory.apply(name); synchronized (this.monitor) { C unregistered = this.contributors.get(adaptedName); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java index b0a063414fc..ec50576cbc4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Health.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,7 @@ public final class Health extends HealthComponent { * @param builder the Builder to use */ private Health(Builder builder) { - Assert.notNull(builder, "Builder must not be null"); + Assert.notNull(builder, "'builder' must not be null"); this.status = builder.status; this.details = Collections.unmodifiableMap(builder.details); } @@ -207,7 +207,7 @@ public final class Health extends HealthComponent { * @param status the {@link Status} to use */ public Builder(Status status) { - Assert.notNull(status, "Status must not be null"); + Assert.notNull(status, "'status' must not be null"); this.status = status; this.details = new LinkedHashMap<>(); } @@ -219,21 +219,21 @@ public final class Health extends HealthComponent { * @param details the details {@link Map} to use */ public Builder(Status status, Map details) { - Assert.notNull(status, "Status must not be null"); - Assert.notNull(details, "Details must not be null"); + Assert.notNull(status, "'status' must not be null"); + Assert.notNull(details, "'details' must not be null"); this.status = status; this.details = new LinkedHashMap<>(details); } /** * Record detail for given {@link Exception}. - * @param ex the exception + * @param exception the exception * @return this {@link Builder} instance */ - public Builder withException(Throwable ex) { - Assert.notNull(ex, "Exception must not be null"); - this.exception = ex; - return withDetail("error", ex.getClass().getName() + ": " + ex.getMessage()); + public Builder withException(Throwable exception) { + Assert.notNull(exception, "'exception' must not be null"); + this.exception = exception; + return withDetail("error", exception.getClass().getName() + ": " + exception.getMessage()); } /** @@ -243,8 +243,8 @@ public final class Health extends HealthComponent { * @return this {@link Builder} instance */ public Builder withDetail(String key, Object value) { - Assert.notNull(key, "Key must not be null"); - Assert.notNull(value, "Value must not be null"); + Assert.notNull(key, "'key' must not be null"); + Assert.notNull(value, "'value' must not be null"); this.details.put(key, value); return this; } @@ -257,7 +257,7 @@ public final class Health extends HealthComponent { * @since 2.1.0 */ public Builder withDetails(Map details) { - Assert.notNull(details, "Details must not be null"); + Assert.notNull(details, "'details' must not be null"); this.details.putAll(details); return this; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointGroups.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointGroups.java index 87e3deb4935..87170a24dd4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointGroups.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointGroups.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ public interface HealthEndpointGroups { * @since 2.6.0 */ default HealthEndpointGroup get(AdditionalHealthEndpointPath path) { - Assert.notNull(path, "Path must not be null"); + Assert.notNull(path, "'path' must not be null"); for (String name : getNames()) { HealthEndpointGroup group = get(name); if (path.equals(group.getAdditionalPath())) { @@ -76,7 +76,7 @@ public interface HealthEndpointGroups { * @since 2.6.0 */ default Set getAllWithAdditionalPath(WebServerNamespace namespace) { - Assert.notNull(namespace, "Namespace must not be null"); + Assert.notNull(namespace, "'namespace' must not be null"); Set filteredGroups = new LinkedHashSet<>(); getNames().stream() .map(this::get) @@ -92,8 +92,8 @@ public interface HealthEndpointGroups { * @return a new {@link HealthEndpointGroups} instance */ static HealthEndpointGroups of(HealthEndpointGroup primary, Map additional) { - Assert.notNull(primary, "Primary must not be null"); - Assert.notNull(additional, "Additional must not be null"); + Assert.notNull(primary, "'primary' must not be null"); + Assert.notNull(additional, "'additional' must not be null"); return new HealthEndpointGroups() { @Override diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java index 79445877bd6..c3b30aa3591 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,8 +63,8 @@ abstract class HealthEndpointSupport { */ HealthEndpointSupport(ContributorRegistry registry, HealthEndpointGroups groups, Duration slowIndicatorLoggingThreshold) { - Assert.notNull(registry, "Registry must not be null"); - Assert.notNull(groups, "Groups must not be null"); + Assert.notNull(registry, "'registry' must not be null"); + Assert.notNull(groups, "'groups' must not be null"); this.registry = registry; this.groups = groups; this.slowIndicatorLoggingThreshold = slowIndicatorLoggingThreshold; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthIndicatorReactiveAdapter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthIndicatorReactiveAdapter.java index 0e9609bda44..ae231c55be7 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthIndicatorReactiveAdapter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthIndicatorReactiveAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ class HealthIndicatorReactiveAdapter implements ReactiveHealthIndicator { private final HealthIndicator delegate; HealthIndicatorReactiveAdapter(HealthIndicator delegate) { - Assert.notNull(delegate, "Delegate must not be null"); + Assert.notNull(delegate, "'delegate' must not be null"); this.delegate = delegate; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributor.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributor.java index 3922eeb4e92..9bf96859d38 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributor.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,8 +42,8 @@ public interface NamedContributor { C getContributor(); static NamedContributor of(String name, C contributor) { - Assert.notNull(name, "Name must not be null"); - Assert.notNull(contributor, "Contributor must not be null"); + Assert.notNull(name, "'name' must not be null"); + Assert.notNull(contributor, "'contributor' must not be null"); return new NamedContributor<>() { @Override diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapter.java index e8ed933cbba..833d13a2884 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,24 +40,25 @@ abstract class NamedContributorsMapAdapter implements NamedContributors private final Map map; NamedContributorsMapAdapter(Map map, Function valueAdapter) { - Assert.notNull(map, "Map must not be null"); - Assert.notNull(valueAdapter, "ValueAdapter must not be null"); - map.keySet().forEach(this::validateKey); - this.map = Collections.unmodifiableMap(map.entrySet() - .stream() - .collect(LinkedHashMap::new, - (result, entry) -> result.put(entry.getKey(), adapt(entry.getValue(), valueAdapter)), Map::putAll)); + Assert.notNull(map, "'map' must not be null"); + Assert.notNull(valueAdapter, "'valueAdapter' must not be null"); + map.keySet().forEach(this::validateMapKey); + this.map = Collections.unmodifiableMap(map.entrySet().stream().collect(LinkedHashMap::new, (result, entry) -> { + String key = entry.getKey(); + C value = adaptMapValue(entry.getValue(), valueAdapter); + result.put(key, value); + }, Map::putAll)); } - private void validateKey(String value) { - Assert.notNull(value, "Map must not contain null keys"); - Assert.isTrue(!value.contains("/"), "Map keys must not contain a '/'"); + private void validateMapKey(String value) { + Assert.notNull(value, "'map' must not contain null keys"); + Assert.isTrue(!value.contains("/"), "'map' keys must not contain a '/'"); } - private C adapt(V value, Function valueAdapter) { + private C adaptMapValue(V value, Function valueAdapter) { C contributor = (value != null) ? valueAdapter.apply(value) : null; - Assert.notNull(contributor, "Map must not contain null values"); + Assert.notNull(contributor, "'map' must not contain null values"); return contributor; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/ReactiveHealthContributor.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/ReactiveHealthContributor.java index 0519c5c2687..2806e1ab543 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/ReactiveHealthContributor.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/ReactiveHealthContributor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ import org.springframework.util.Assert; public interface ReactiveHealthContributor { static ReactiveHealthContributor adapt(HealthContributor healthContributor) { - Assert.notNull(healthContributor, "HealthContributor must not be null"); + Assert.notNull(healthContributor, "'healthContributor' must not be null"); if (healthContributor instanceof HealthIndicator healthIndicator) { return new HealthIndicatorReactiveAdapter(healthIndicator); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Status.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Status.java index d4113e57a6f..81ec7f655d4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Status.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/Status.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,8 +78,8 @@ public final class Status { * @param description a description of the status */ public Status(String code, String description) { - Assert.notNull(code, "Code must not be null"); - Assert.notNull(description, "Description must not be null"); + Assert.notNull(code, "'code' must not be null"); + Assert.notNull(description, "'description' must not be null"); this.code = code; this.description = description; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/InfoEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/InfoEndpoint.java index 2c48fc18d2d..d293d6eb141 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/InfoEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/InfoEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ public class InfoEndpoint { * @param infoContributors the info contributors to use */ public InfoEndpoint(List infoContributors) { - Assert.notNull(infoContributors, "Info contributors must not be null"); + Assert.notNull(infoContributors, "'infoContributors' must not be null"); this.infoContributors = infoContributors; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/SimpleInfoContributor.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/SimpleInfoContributor.java index ca841638d33..fce74e4a291 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/SimpleInfoContributor.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/SimpleInfoContributor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ public class SimpleInfoContributor implements InfoContributor { private final Object detail; public SimpleInfoContributor(String prefix, Object detail) { - Assert.notNull(prefix, "Prefix must not be null"); + Assert.notNull(prefix, "'prefix' must not be null"); this.prefix = prefix; this.detail = detail; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/ldap/LdapHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/ldap/LdapHealthIndicator.java index 2000e549b62..d02a3bbf449 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/ldap/LdapHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/ldap/LdapHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ public class LdapHealthIndicator extends AbstractHealthIndicator { public LdapHealthIndicator(LdapOperations ldapOperations) { super("LDAP health check failed"); - Assert.notNull(ldapOperations, "LdapOperations must not be null"); + Assert.notNull(ldapOperations, "'ldapOperations' must not be null"); this.ldapOperations = ldapOperations; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpoint.java index a7474dd1887..233b020112b 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/liquibase/LiquibaseEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class LiquibaseEndpoint { private final ApplicationContext context; public LiquibaseEndpoint(ApplicationContext context) { - Assert.notNull(context, "Context must be specified"); + Assert.notNull(context, "'context' must be specified"); this.context = context; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java index b46eb95a8d4..dc25b1cf7f2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,8 +64,8 @@ public class LoggersEndpoint { * @param loggerGroups the logger group to expose */ public LoggersEndpoint(LoggingSystem loggingSystem, LoggerGroups loggerGroups) { - Assert.notNull(loggingSystem, "LoggingSystem must not be null"); - Assert.notNull(loggerGroups, "LoggerGroups must not be null"); + Assert.notNull(loggingSystem, "'loggingSystem' must not be null"); + Assert.notNull(loggerGroups, "'loggerGroups' must not be null"); this.loggingSystem = loggingSystem; this.loggerGroups = loggerGroups; } @@ -88,7 +88,7 @@ public class LoggersEndpoint { @ReadOperation public LoggerLevelsDescriptor loggerLevels(@Selector String name) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); LoggerGroup group = this.loggerGroups.get(name); if (group != null) { return new GroupLoggerLevelsDescriptor(group.getConfiguredLevel(), group.getMembers()); @@ -99,7 +99,7 @@ public class LoggersEndpoint { @WriteOperation public void configureLogLevel(@Selector String name, @Nullable LogLevel configuredLevel) { - Assert.notNull(name, "Name must not be empty"); + Assert.notNull(name, "'name' must not be empty"); LoggerGroup group = this.loggerGroups.get(name); if (group != null && group.hasMembers()) { group.configureLogLevel(configuredLevel, this.loggingSystem::setLogLevel); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/amqp/RabbitMetrics.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/amqp/RabbitMetrics.java index 911f858e57a..6054386f180 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/amqp/RabbitMetrics.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/amqp/RabbitMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ public class RabbitMetrics implements MeterBinder { * @param tags tags to apply to all recorded metrics */ public RabbitMetrics(ConnectionFactory connectionFactory, Iterable tags) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); + Assert.notNull(connectionFactory, "'connectionFactory' must not be null"); this.connectionFactory = connectionFactory; this.tags = (tags != null) ? tags : Collections.emptyList(); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManager.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManager.java index dc3ebe4d31a..da9061c3223 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManager.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,11 +87,11 @@ public class PrometheusPushGatewayManager { */ public PrometheusPushGatewayManager(PushGateway pushGateway, CollectorRegistry registry, TaskScheduler scheduler, Duration pushRate, String job, Map groupingKey, ShutdownOperation shutdownOperation) { - Assert.notNull(pushGateway, "PushGateway must not be null"); - Assert.notNull(registry, "Registry must not be null"); - Assert.notNull(scheduler, "Scheduler must not be null"); - Assert.notNull(pushRate, "PushRate must not be null"); - Assert.hasLength(job, "Job must not be empty"); + Assert.notNull(pushGateway, "'pushGateway' must not be null"); + Assert.notNull(registry, "'registry' must not be null"); + Assert.notNull(scheduler, "'scheduler' must not be null"); + Assert.notNull(pushRate, "'pushRate' must not be null"); + Assert.hasLength(job, "'job' must not be empty"); this.pushGateway = pushGateway; this.registry = registry; this.job = job; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/jdbc/DataSourcePoolMetrics.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/jdbc/DataSourcePoolMetrics.java index f22023a1ef2..afa0efc3603 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/jdbc/DataSourcePoolMetrics.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/jdbc/DataSourcePoolMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,8 +56,8 @@ public class DataSourcePoolMetrics implements MeterBinder { public DataSourcePoolMetrics(DataSource dataSource, DataSourcePoolMetadataProvider metadataProvider, String name, Iterable tags) { - Assert.notNull(dataSource, "DataSource must not be null"); - Assert.notNull(metadataProvider, "MetadataProvider must not be null"); + Assert.notNull(dataSource, "'dataSource' must not be null"); + Assert.notNull(metadataProvider, "'metadataProvider' must not be null"); this.dataSource = dataSource; this.metadataProvider = new CachingDataSourcePoolMetadataProvider(metadataProvider); this.tags = Tags.concat(tags, "name", name); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/system/DiskSpaceMetricsBinder.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/system/DiskSpaceMetricsBinder.java index d2bcf25ce0d..e19a43f93f2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/system/DiskSpaceMetricsBinder.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/system/DiskSpaceMetricsBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ public class DiskSpaceMetricsBinder implements MeterBinder { private final Iterable tags; public DiskSpaceMetricsBinder(List paths, Iterable tags) { - Assert.notEmpty(paths, "Paths must not be empty"); + Assert.notEmpty(paths, "'paths' must not be empty"); this.paths = paths; this.tags = tags; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/ObservationRestClientCustomizer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/ObservationRestClientCustomizer.java index 904e9426034..7ae543714d8 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/ObservationRestClientCustomizer.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/ObservationRestClientCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,8 +43,8 @@ public class ObservationRestClientCustomizer implements RestClientCustomizer { */ public ObservationRestClientCustomizer(ObservationRegistry observationRegistry, ClientRequestObservationConvention observationConvention) { - Assert.notNull(observationConvention, "ObservationConvention must not be null"); - Assert.notNull(observationRegistry, "ObservationRegistry must not be null"); + Assert.notNull(observationConvention, "'observationConvention' must not be null"); + Assert.notNull(observationRegistry, "'observationRegistry' must not be null"); this.observationRegistry = observationRegistry; this.observationConvention = observationConvention; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/quartz/QuartzEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/quartz/QuartzEndpoint.java index e6cdde6920d..a858b375fd6 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/quartz/QuartzEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/quartz/QuartzEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,7 +75,7 @@ public class QuartzEndpoint { private final Sanitizer sanitizer; public QuartzEndpoint(Scheduler scheduler, Iterable sanitizingFunctions) { - Assert.notNull(scheduler, "Scheduler must not be null"); + Assert.notNull(scheduler, "'scheduler' must not be null"); this.scheduler = scheduler; this.sanitizer = new Sanitizer(sanitizingFunctions); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicator.java index d1c3d942cba..07a0fcd1c26 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ public class ConnectionFactoryHealthIndicator extends AbstractReactiveHealthIndi * validation */ public ConnectionFactoryHealthIndicator(ConnectionFactory connectionFactory, String validationQuery) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); + Assert.notNull(connectionFactory, "'connectionFactory' must not be null"); this.connectionFactory = connectionFactory; this.validationQuery = validationQuery; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/ReactiveSessionsEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/ReactiveSessionsEndpoint.java index 9ee15d69fc0..d8e6bfe7559 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/ReactiveSessionsEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/ReactiveSessionsEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ public class ReactiveSessionsEndpoint { */ public ReactiveSessionsEndpoint(ReactiveSessionRepository sessionRepository, ReactiveFindByIndexNameSessionRepository indexedSessionRepository) { - Assert.notNull(sessionRepository, "ReactiveSessionRepository must not be null"); + Assert.notNull(sessionRepository, "'sessionRepository' must not be null"); this.sessionRepository = sessionRepository; this.indexedSessionRepository = indexedSessionRepository; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/SessionsEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/SessionsEndpoint.java index 1b89c83a113..d09c88cb506 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/SessionsEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/SessionsEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,7 @@ public class SessionsEndpoint { */ public SessionsEndpoint(SessionRepository sessionRepository, FindByIndexNameSessionRepository indexedSessionRepository) { - Assert.notNull(sessionRepository, "SessionRepository must not be null"); + Assert.notNull(sessionRepository, "'sessionRepository' must not be null"); this.sessionRepository = sessionRepository; this.indexedSessionRepository = indexedSessionRepository; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/exchanges/HttpExchangesEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/exchanges/HttpExchangesEndpoint.java index a6837093276..321e660ef20 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/exchanges/HttpExchangesEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/exchanges/HttpExchangesEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ public class HttpExchangesEndpoint { * @param repository the exchange repository */ public HttpExchangesEndpoint(HttpExchangeRepository repository) { - Assert.notNull(repository, "Repository must not be null"); + Assert.notNull(repository, "'repository' must not be null"); this.repository = repository; } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/amqp/RabbitHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/amqp/RabbitHealthIndicatorTests.java index 63856b2f16b..4a10bee8156 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/amqp/RabbitHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/amqp/RabbitHealthIndicatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class RabbitHealthIndicatorTests { @Test void createWhenRabbitTemplateIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new RabbitHealthIndicator(null)) - .withMessageContaining("RabbitTemplate must not be null"); + .withMessageContaining("'rabbitTemplate' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventTests.java index 97b3cd270ff..76874202420 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/AuditEventTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,14 +60,14 @@ class AuditEventTests { void nullTimestamp() { assertThatIllegalArgumentException() .isThrownBy(() -> new AuditEvent(null, "phil", "UNKNOWN", Collections.singletonMap("a", "b"))) - .withMessageContaining("Timestamp must not be null"); + .withMessageContaining("'timestamp' must not be null"); } @Test void nullType() { assertThatIllegalArgumentException() .isThrownBy(() -> new AuditEvent("phil", null, Collections.singletonMap("a", "b"))) - .withMessageContaining("Type must not be null"); + .withMessageContaining("'type' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java index cb1ab539569..da400a148df 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/audit/InMemoryAuditEventRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ class InMemoryAuditEventRepositoryTests { void addNullAuditEvent() { InMemoryAuditEventRepository repository = new InMemoryAuditEventRepository(); assertThatIllegalArgumentException().isThrownBy(() -> repository.add(null)) - .withMessageContaining("AuditEvent must not be null"); + .withMessageContaining("'event' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicatorTests.java index ea48c0a17cf..cc40f23f631 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/availability/AvailabilityStateHealthIndicatorTests.java @@ -47,7 +47,7 @@ class AvailabilityStateHealthIndicatorTests { assertThatIllegalArgumentException() .isThrownBy(() -> new AvailabilityStateHealthIndicator(null, LivenessState.class, (statusMappings) -> { })) - .withMessage("ApplicationAvailability must not be null"); + .withMessage("'applicationAvailability' must not be null"); } @Test @@ -55,7 +55,7 @@ class AvailabilityStateHealthIndicatorTests { assertThatIllegalArgumentException().isThrownBy( () -> new AvailabilityStateHealthIndicator(this.applicationAvailability, null, (statusMappings) -> { })) - .withMessage("StateType must not be null"); + .withMessage("'stateType' must not be null"); } @Test @@ -63,7 +63,7 @@ class AvailabilityStateHealthIndicatorTests { assertThatIllegalArgumentException() .isThrownBy( () -> new AvailabilityStateHealthIndicator(this.applicationAvailability, LivenessState.class, null)) - .withMessage("StatusMappings must not be null"); + .withMessage("'statusMappings' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java index bc57d0a1d05..687010d0563 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,42 +37,43 @@ class EndpointIdTests { @Test void ofWhenNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of(null)) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test void ofWhenEmptyThrowsException() { - assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("")).withMessage("Value must not be empty"); + assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("")) + .withMessage("'value' must not be empty"); } @Test void ofWhenContainsSlashThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("foo/bar")) - .withMessage("Value must only contain valid chars"); + .withMessage("'value' must only contain valid chars"); } @Test void ofWhenContainsBackslashThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("foo\\bar")) - .withMessage("Value must only contain valid chars"); + .withMessage("'value' must only contain valid chars"); } @Test void ofWhenHasBadCharThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("foo!bar")) - .withMessage("Value must only contain valid chars"); + .withMessage("'value' must only contain valid chars"); } @Test void ofWhenStartsWithNumberThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("1foo")) - .withMessage("Value must not start with a number"); + .withMessage("'value' must not start with a number"); } @Test void ofWhenStartsWithUppercaseLetterThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("Foo")) - .withMessage("Value must not start with an uppercase letter"); + .withMessage("'value' must not start with an uppercase letter"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/InvocationContextTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/InvocationContextTests.java index 84f2a83279c..41f59d2f53a 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/InvocationContextTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/InvocationContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,13 +45,13 @@ class InvocationContextTests { @Test void createWhenSecurityContextIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new InvocationContext(null, this.arguments)) - .withMessage("SecurityContext must not be null"); + .withMessage("'securityContext' must not be null"); } @Test void createWhenArgumentsIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new InvocationContext(this.securityContext, null)) - .withMessage("Arguments must not be null"); + .withMessage("'arguments' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/DiscoveredOperationMethodTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/DiscoveredOperationMethodTests.java index 9c85115b416..f04764af6ce 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/DiscoveredOperationMethodTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/DiscoveredOperationMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ class DiscoveredOperationMethodTests { Method method = ReflectionUtils.findMethod(getClass(), "example"); assertThatIllegalArgumentException() .isThrownBy(() -> new DiscoveredOperationMethod(method, OperationType.READ, null)) - .withMessageContaining("AnnotationAttributes must not be null"); + .withMessageContaining("'annotationAttributes' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/DiscovererEndpointFilterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/DiscovererEndpointFilterTests.java index b457b2fa951..ecaa0a2f36d 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/DiscovererEndpointFilterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/DiscovererEndpointFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ class DiscovererEndpointFilterTests { @Test void createWhenDiscovererIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new TestDiscovererEndpointFilter(null)) - .withMessageContaining("Discoverer must not be null"); + .withMessageContaining("'discoverer' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java index 131e0e76ef7..2c3dc531f4e 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,7 @@ class EndpointDiscovererTests { assertThatIllegalArgumentException() .isThrownBy(() -> new TestEndpointDiscoverer(null, mock(ParameterValueMapper.class), Collections.emptyList(), Collections.emptyList())) - .withMessageContaining("ApplicationContext must not be null"); + .withMessageContaining("'applicationContext' must not be null"); } @Test @@ -84,7 +84,7 @@ class EndpointDiscovererTests { assertThatIllegalArgumentException() .isThrownBy(() -> new TestEndpointDiscoverer(mock(ApplicationContext.class), null, Collections.emptyList(), Collections.emptyList())) - .withMessageContaining("ParameterValueMapper must not be null"); + .withMessageContaining("'parameterValueMapper' must not be null"); } @Test @@ -92,7 +92,7 @@ class EndpointDiscovererTests { assertThatIllegalArgumentException() .isThrownBy(() -> new TestEndpointDiscoverer(mock(ApplicationContext.class), mock(ParameterValueMapper.class), null, Collections.emptyList())) - .withMessageContaining("InvokerAdvisors must not be null"); + .withMessageContaining("'invokerAdvisors' must not be null"); } @Test @@ -100,7 +100,7 @@ class EndpointDiscovererTests { assertThatIllegalArgumentException() .isThrownBy(() -> new TestEndpointDiscoverer(mock(ApplicationContext.class), mock(ParameterValueMapper.class), Collections.emptyList(), null)) - .withMessageContaining("Filters must not be null"); + .withMessageContaining("'endpointFilters' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParametersTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParametersTests.java index 7f7a1f12bbe..8c2d7ebf118 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParametersTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParametersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,13 +51,13 @@ class OperationMethodParametersTests { void createWhenMethodIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new OperationMethodParameters(null, mock(ParameterNameDiscoverer.class))) - .withMessageContaining("Method must not be null"); + .withMessageContaining("'method' must not be null"); } @Test void createWhenParameterNameDiscovererIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new OperationMethodParameters(this.exampleMethod, null)) - .withMessageContaining("ParameterNameDiscoverer must not be null"); + .withMessageContaining("'parameterNameDiscoverer' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java index 46dea6abe31..bc4856fbd25 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,13 +39,13 @@ class OperationMethodTests { @Test void createWhenMethodIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new OperationMethod(null, OperationType.READ)) - .withMessageContaining("Method must not be null"); + .withMessageContaining("'method' must not be null"); } @Test void createWhenOperationTypeIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new OperationMethod(this.exampleMethod, null)) - .withMessageContaining("OperationType must not be null"); + .withMessageContaining("'operationType' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvokerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvokerTests.java index 9e7cab081a6..a59cbabd6b2 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvokerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvokerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,21 +60,21 @@ class ReflectiveOperationInvokerTests { void createWhenTargetIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new ReflectiveOperationInvoker(null, this.operationMethod, this.parameterValueMapper)) - .withMessageContaining("Target must not be null"); + .withMessageContaining("'target' must not be null"); } @Test void createWhenOperationMethodIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new ReflectiveOperationInvoker(this.target, null, this.parameterValueMapper)) - .withMessageContaining("OperationMethod must not be null"); + .withMessageContaining("'operationMethod' must not be null"); } @Test void createWhenParameterValueMapperIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new ReflectiveOperationInvoker(this.target, this.operationMethod, null)) - .withMessageContaining("ParameterValueMapper must not be null"); + .withMessageContaining("'parameterValueMapper' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerTests.java index 33f89600192..477c9e07942 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ class CachingOperationInvokerTests { void createInstanceWithTtlSetToZero() { assertThatIllegalArgumentException() .isThrownBy(() -> new CachingOperationInvoker(mock(OperationInvoker.class), 0)) - .withMessageContaining("TimeToLive"); + .withMessage("'timeToLive' must be greater than zero"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java index 442bd367c94..6a8d59f4b47 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,14 +63,14 @@ class EndpointMBeanTests { void createWhenResponseMapperIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new EndpointMBean(null, null, mock(ExposableJmxEndpoint.class))) - .withMessageContaining("ResponseMapper must not be null"); + .withMessageContaining("'responseMapper' must not be null"); } @Test void createWhenEndpointIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new EndpointMBean(mock(JmxOperationResponseMapper.class), null, null)) - .withMessageContaining("Endpoint must not be null"); + .withMessageContaining("'endpoint' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java index cfd0a8d2162..641529a2f12 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,21 +77,21 @@ class JmxEndpointExporterTests { assertThatIllegalArgumentException() .isThrownBy( () -> new JmxEndpointExporter(null, this.objectNameFactory, this.responseMapper, this.endpoints)) - .withMessageContaining("MBeanServer must not be null"); + .withMessageContaining("'mBeanServer' must not be null"); } @Test void createWhenObjectNameFactoryIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new JmxEndpointExporter(this.mBeanServer, null, this.responseMapper, this.endpoints)) - .withMessageContaining("ObjectNameFactory must not be null"); + .withMessageContaining("'objectNameFactory' must not be null"); } @Test void createWhenResponseMapperIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new JmxEndpointExporter(this.mBeanServer, this.objectNameFactory, null, this.endpoints)) - .withMessageContaining("ResponseMapper must not be null"); + .withMessageContaining("'responseMapper' must not be null"); } @Test @@ -99,7 +99,7 @@ class JmxEndpointExporterTests { assertThatIllegalArgumentException() .isThrownBy( () -> new JmxEndpointExporter(this.mBeanServer, this.objectNameFactory, this.responseMapper, null)) - .withMessageContaining("Endpoints must not be null"); + .withMessageContaining("'endpoints' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointMediaTypesTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointMediaTypesTests.java index a9495d188e5..ae672f95686 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointMediaTypesTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointMediaTypesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,13 +47,13 @@ class EndpointMediaTypesTests { @Test void createWhenProducedIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new EndpointMediaTypes(null, Collections.emptyList())) - .withMessageContaining("Produced must not be null"); + .withMessageContaining("'produced' must not be null"); } @Test void createWhenConsumedIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new EndpointMediaTypes(Collections.emptyList(), null)) - .withMessageContaining("Consumed must not be null"); + .withMessageContaining("'consumed' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java index 1a1d8cf247b..91eaec87ac7 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,13 +42,13 @@ class EndpointServletTests { @Test void createWhenServletClassIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new EndpointServlet((Class) null)) - .withMessageContaining("Servlet must not be null"); + .withMessageContaining("'servlet' must not be null"); } @Test void createWhenServletIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new EndpointServlet((Servlet) null)) - .withMessageContaining("Servlet must not be null"); + .withMessageContaining("'servlet' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/LinkTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/LinkTests.java index 65f5a43183c..104e56bb128 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/LinkTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/LinkTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ class LinkTests { @Test void createWhenHrefIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new Link(null)) - .withMessageContaining("HREF must not be null"); + .withMessageContaining("'href' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpointsTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpointsTests.java index 1d5b2b466c1..38d4865b1d2 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpointsTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpointsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,14 +43,14 @@ class PathMappedEndpointsTests { void createWhenSupplierIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new PathMappedEndpoints(null, (WebEndpointsSupplier) null)) - .withMessageContaining("Supplier must not be null"); + .withMessageContaining("'supplier' must not be null"); } @Test void createWhenSuppliersIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new PathMappedEndpoints(null, (Collection>) null)) - .withMessageContaining("Suppliers must not be null"); + .withMessageContaining("'suppliers' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java index 6e9c9dacae1..2c698bcdda8 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ class ServletEndpointRegistrarTests { @Test void createWhenServletEndpointsIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new ServletEndpointRegistrar(null, null)) - .withMessageContaining("ServletEndpoints must not be null"); + .withMessageContaining("'servletEndpoints' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapterTests.java index 1a2916ad08b..7b37f84eec7 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthContributorReactiveAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ class CompositeHealthContributorReactiveAdapterTests { @Test void createWhenDelegateIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new CompositeHealthContributorReactiveAdapter(null)) - .withMessage("Delegate must not be null"); + .withMessage("'delegate' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java index 0d8d51112ee..57b70b3ace2 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ class CompositeHealthTests { void createWhenStatusIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> new CompositeHealth(ApiVersion.V3, null, Collections.emptyMap())) - .withMessage("Status must not be null"); + .withMessage("'status' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointGroupsTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointGroupsTests.java index a9e8058a563..6f16226f1e0 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointGroupsTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointGroupsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,14 +34,14 @@ class HealthEndpointGroupsTests { @Test void ofWhenPrimaryIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> HealthEndpointGroups.of(null, Collections.emptyMap())) - .withMessage("Primary must not be null"); + .withMessage("'primary' must not be null"); } @Test void ofWhenAdditionalIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> HealthEndpointGroups.of(mock(HealthEndpointGroup.class), null)) - .withMessage("Additional must not be null"); + .withMessage("'additional' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointSupportTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointSupportTests.java index 8af31ccdbf4..59e08c0430e 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointSupportTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthEndpointSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,13 +64,13 @@ abstract class HealthEndpointSupportTests, @Test void createWhenRegistryIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> create(null, this.groups)) - .withMessage("Registry must not be null"); + .withMessage("'registry' must not be null"); } @Test void createWhenGroupsIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> create(this.registry, null)) - .withMessage("Groups must not be null"); + .withMessage("'groups' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthTests.java index 5f0aba84217..990b0493af6 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ class HealthTests { @Test void statusMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new Health.Builder(null, null)) - .withMessageContaining("Status must not be null"); + .withMessageContaining("'status' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorTests.java index a26c1e460e5..abab9106ab7 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,13 +38,13 @@ class NamedContributorTests { @Test void ofWhenNameIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> NamedContributor.of(null, "two")) - .withMessage("Name must not be null"); + .withMessage("'name' must not be null"); } @Test void ofWhenContributorIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> NamedContributor.of("one", null)) - .withMessage("Contributor must not be null"); + .withMessage("'contributor' must not be null"); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapterTests.java index 9794a32b09c..b673d85c569 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/NamedContributorsMapAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,14 +40,14 @@ class NamedContributorsMapAdapterTests { void createWhenMapIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> new TestNamedContributorsMapAdapter<>(null, Function.identity())) - .withMessage("Map must not be null"); + .withMessage("'map' must not be null"); } @Test void createWhenValueAdapterIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> new TestNamedContributorsMapAdapter<>(Collections.emptyMap(), null)) - .withMessage("ValueAdapter must not be null"); + .withMessage("'valueAdapter' must not be null"); } @Test @@ -55,7 +55,7 @@ class NamedContributorsMapAdapterTests { assertThatIllegalArgumentException() .isThrownBy(() -> new TestNamedContributorsMapAdapter<>(Collections.singletonMap("test", null), Function.identity())) - .withMessage("Map must not contain null values"); + .withMessage("'map' must not contain null values"); } @Test @@ -63,7 +63,7 @@ class NamedContributorsMapAdapterTests { assertThatIllegalArgumentException() .isThrownBy(() -> new TestNamedContributorsMapAdapter<>(Collections.singletonMap(null, "test"), Function.identity())) - .withMessage("Map must not contain null keys"); + .withMessage("'map' must not contain null keys"); } @Test @@ -71,7 +71,7 @@ class NamedContributorsMapAdapterTests { assertThatIllegalArgumentException() .isThrownBy(() -> new TestNamedContributorsMapAdapter<>(Collections.singletonMap("test/key", "test"), Function.identity())) - .withMessage("Map keys must not contain a '/'"); + .withMessage("'map' keys must not contain a '/'"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ReactiveHealthContributorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ReactiveHealthContributorTests.java index 2acf5a61f3c..545c5217c6c 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ReactiveHealthContributorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ReactiveHealthContributorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ class ReactiveHealthContributorTests { @Test void adaptWhenNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ReactiveHealthContributor.adapt(null)) - .withMessage("HealthContributor must not be null"); + .withMessage("'healthContributor' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/StatusTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/StatusTests.java index f9284dd4331..91f27a99643 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/StatusTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/StatusTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,13 +32,13 @@ class StatusTests { @Test void createWhenCodeIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new Status(null, "")) - .withMessage("Code must not be null"); + .withMessage("'code' must not be null"); } @Test void createWhenDescriptionIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new Status("code", null)) - .withMessage("Description must not be null"); + .withMessage("'description' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java index 6960ea72275..d14202c1dd9 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,7 @@ class PrometheusPushGatewayManagerTests { assertThatIllegalArgumentException() .isThrownBy(() -> new PrometheusPushGatewayManager(null, this.registry, this.scheduler, this.pushRate, "job", this.groupingKey, null)) - .withMessage("PushGateway must not be null"); + .withMessage("'pushGateway' must not be null"); } @Test @@ -84,7 +84,7 @@ class PrometheusPushGatewayManagerTests { assertThatIllegalArgumentException() .isThrownBy(() -> new PrometheusPushGatewayManager(this.pushGateway, null, this.scheduler, this.pushRate, "job", this.groupingKey, null)) - .withMessage("Registry must not be null"); + .withMessage("'registry' must not be null"); } @Test @@ -92,7 +92,7 @@ class PrometheusPushGatewayManagerTests { assertThatIllegalArgumentException() .isThrownBy(() -> new PrometheusPushGatewayManager(this.pushGateway, this.registry, null, this.pushRate, "job", this.groupingKey, null)) - .withMessage("Scheduler must not be null"); + .withMessage("'scheduler' must not be null"); } @Test @@ -100,7 +100,7 @@ class PrometheusPushGatewayManagerTests { assertThatIllegalArgumentException() .isThrownBy(() -> new PrometheusPushGatewayManager(this.pushGateway, this.registry, this.scheduler, null, "job", this.groupingKey, null)) - .withMessage("PushRate must not be null"); + .withMessage("'pushRate' must not be null"); } @Test @@ -108,7 +108,7 @@ class PrometheusPushGatewayManagerTests { assertThatIllegalArgumentException() .isThrownBy(() -> new PrometheusPushGatewayManager(this.pushGateway, this.registry, this.scheduler, this.pushRate, "", this.groupingKey, null)) - .withMessage("Job must not be empty"); + .withMessage("'job' must not be empty"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java index 043da47b27c..4dee33cacd2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationSorter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class AutoConfigurationSorter { AutoConfigurationSorter(MetadataReaderFactory metadataReaderFactory, AutoConfigurationMetadata autoConfigurationMetadata, UnaryOperator replacementMapper) { - Assert.notNull(metadataReaderFactory, "MetadataReaderFactory must not be null"); + Assert.notNull(metadataReaderFactory, "'metadataReaderFactory' must not be null"); this.metadataReaderFactory = metadataReaderFactory; this.autoConfigurationMetadata = autoConfigurationMetadata; this.replacementMapper = replacementMapper; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractConnectionFactoryConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractConnectionFactoryConfigurer.java index d5f1a12c666..5a3bc1cb0d1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractConnectionFactoryConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractConnectionFactoryConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,8 +61,8 @@ public abstract class AbstractConnectionFactoryConfigurer "Cache configuration does not exist '" + config.getDescription() + "'"); + () -> "'config' resource [%s] must exist".formatted(config.getDescription())); return config; } return null; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/AbstractNestedCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/AbstractNestedCondition.java index 1a317b0b5fe..82a8d5460a7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/AbstractNestedCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/AbstractNestedCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public abstract class AbstractNestedCondition extends SpringBootCondition implem private final ConfigurationPhase configurationPhase; AbstractNestedCondition(ConfigurationPhase configurationPhase) { - Assert.notNull(configurationPhase, "ConfigurationPhase must not be null"); + Assert.notNull(configurationPhase, "'configurationPhase' must not be null"); this.configurationPhase = configurationPhase; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java index 3126167f106..702a456d823 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,9 +76,9 @@ public final class ConditionEvaluationReport { * @param outcome the condition outcome */ public void recordConditionEvaluation(String source, Condition condition, ConditionOutcome outcome) { - Assert.notNull(source, "Source must not be null"); - Assert.notNull(condition, "Condition must not be null"); - Assert.notNull(outcome, "Outcome must not be null"); + Assert.notNull(source, "'source' must not be null"); + Assert.notNull(condition, "'condition' must not be null"); + Assert.notNull(outcome, "'outcome' must not be null"); this.unconditionalClasses.remove(source); this.outcomes.computeIfAbsent(source, (key) -> new ConditionAndOutcomes()).add(condition, outcome); this.addedAncestorOutcomes = false; @@ -89,7 +89,7 @@ public final class ConditionEvaluationReport { * @param exclusions the names of the excluded classes */ public void recordExclusions(Collection exclusions) { - Assert.notNull(exclusions, "exclusions must not be null"); + Assert.notNull(exclusions, "'exclusions' must not be null"); this.exclusions.addAll(exclusions); } @@ -99,7 +99,7 @@ public final class ConditionEvaluationReport { * evaluated */ public void recordEvaluationCandidates(List evaluationCandidates) { - Assert.notNull(evaluationCandidates, "evaluationCandidates must not be null"); + Assert.notNull(evaluationCandidates, "'evaluationCandidates' must not be null"); this.unconditionalClasses.addAll(evaluationCandidates); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java index 9b0a0a40a17..1f4e2c898a3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,7 +108,7 @@ public final class ConditionMessage { * @see #forCondition(Class, Object...) */ public Builder andCondition(Class condition, Object... details) { - Assert.notNull(condition, "Condition must not be null"); + Assert.notNull(condition, "'condition' must not be null"); return andCondition("@" + ClassUtils.getShortName(condition), details); } @@ -122,7 +122,7 @@ public final class ConditionMessage { * @see #forCondition(String, Object...) */ public Builder andCondition(String condition, Object... details) { - Assert.notNull(condition, "Condition must not be null"); + Assert.notNull(condition, "'condition' must not be null"); String detail = StringUtils.arrayToDelimitedString(details, " "); if (StringUtils.hasLength(detail)) { return new Builder(condition + " " + detail); @@ -379,7 +379,7 @@ public final class ConditionMessage { * @return a built {@link ConditionMessage} */ public ConditionMessage items(Style style, Collection items) { - Assert.notNull(style, "Style must not be null"); + Assert.notNull(style, "'style' must not be null"); StringBuilder message = new StringBuilder(this.reason); items = style.applyTo(items); if ((this.condition == null || items == null || items.size() <= 1) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java index ebaa1ae33b6..da09605f4c3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public class ConditionOutcome { * @param message the condition message */ public ConditionOutcome(boolean match, ConditionMessage message) { - Assert.notNull(message, "ConditionMessage must not be null"); + Assert.notNull(message, "'message' must not be null"); this.match = match; this.message = message; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDatabaseFactoryDependentConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDatabaseFactoryDependentConfiguration.java index ba0f6a1a95f..381db02c36f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDatabaseFactoryDependentConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoDatabaseFactoryDependentConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,8 +77,8 @@ class MongoDatabaseFactoryDependentConfiguration { GridFsMongoDatabaseFactory(MongoDatabaseFactory mongoDatabaseFactory, MongoConnectionDetails connectionDetails) { - Assert.notNull(mongoDatabaseFactory, "MongoDatabaseFactory must not be null"); - Assert.notNull(connectionDetails, "ConnectionDetails must not be null"); + Assert.notNull(mongoDatabaseFactory, "'mongoDatabaseFactory' must not be null"); + Assert.notNull(connectionDetails, "'connectionDetails' must not be null"); this.mongoDatabaseFactory = mongoDatabaseFactory; this.connectionDetails = connectionDetails; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionDetails.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionDetails.java index b423e61ab2e..047f6b23799 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionDetails.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisConnectionDetails.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,7 +103,7 @@ public interface RedisConnectionDetails extends ConnectionDetails { } static Standalone of(String host, int port, int database) { - Assert.hasLength(host, "Host must not be empty"); + Assert.hasLength(host, "'host' must not be empty"); return new Standalone() { @Override diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzer.java index 10d5f215961..96a4d0f34b1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,7 +65,8 @@ class NoSuchBeanDefinitionFailureAnalyzer extends AbstractInjectionFailureAnalyz private final ConditionEvaluationReport report; NoSuchBeanDefinitionFailureAnalyzer(BeanFactory beanFactory) { - Assert.isInstanceOf(ConfigurableListableBeanFactory.class, beanFactory); + Assert.isTrue(beanFactory instanceof ConfigurableListableBeanFactory, + "'beanFactory' must be a ConfigurableListableBeanFactory"); this.beanFactory = (ConfigurableListableBeanFactory) beanFactory; this.metadataReaderFactory = new CachingMetadataReaderFactory(this.beanFactory.getBeanClassLoader()); // Get early as won't be accessible once context has failed to start diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanPackages.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanPackages.java index 82c0ce9178f..0da1e322984 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanPackages.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanPackages.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,8 +96,8 @@ public class EntityScanPackages { * @param packageNames the package names to register */ public static void register(BeanDefinitionRegistry registry, String... packageNames) { - Assert.notNull(registry, "Registry must not be null"); - Assert.notNull(packageNames, "PackageNames must not be null"); + Assert.notNull(registry, "'registry' must not be null"); + Assert.notNull(packageNames, "'packageNames' must not be null"); register(registry, Arrays.asList(packageNames)); } @@ -107,8 +107,8 @@ public class EntityScanPackages { * @param packageNames the package names to register */ public static void register(BeanDefinitionRegistry registry, Collection packageNames) { - Assert.notNull(registry, "Registry must not be null"); - Assert.notNull(packageNames, "PackageNames must not be null"); + Assert.notNull(registry, "'registry' must not be null"); + Assert.notNull(packageNames, "'packageNames' must not be null"); if (registry.containsBeanDefinition(BEAN)) { EntityScanPackagesBeanDefinition beanDefinition = (EntityScanPackagesBeanDefinition) registry .getBeanDefinition(BEAN); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java index 4fb4efd0a9d..8b291eb82fa 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ public class EntityScanner { * @param context the source application context */ public EntityScanner(ApplicationContext context) { - Assert.notNull(context, "Context must not be null"); + Assert.notNull(context, "'context' must not be null"); this.context = context; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java index 444270cb05f..cdd3f1f1d62 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class FlywayMigrationInitializer implements InitializingBean, Ordered { * @param migrationStrategy the migration strategy or {@code null} */ public FlywayMigrationInitializer(Flyway flyway, FlywayMigrationStrategy migrationStrategy) { - Assert.notNull(flyway, "Flyway must not be null"); + Assert.notNull(flyway, "'flyway' must not be null"); this.flyway = flyway; this.migrationStrategy = migrationStrategy; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java index a1dc97a034f..09dba6b7b56 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,9 +47,9 @@ public class H2ConsoleProperties { } public void setPath(String path) { - Assert.notNull(path, "Path must not be null"); - Assert.isTrue(path.length() > 1, "Path must have length greater than 1"); - Assert.isTrue(path.startsWith("/"), "Path must start with '/'"); + Assert.notNull(path, "'path' must not be null"); + Assert.isTrue(path.length() > 1, "'path' must have length greater than 1"); + Assert.isTrue(path.startsWith("/"), "'path' must start with '/'"); this.path = path; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigResourceCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigResourceCondition.java index af5054c9eb2..9ff61bf97df 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigResourceCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastConfigResourceCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ public abstract class HazelcastConfigResourceCondition extends ResourceCondition protected HazelcastConfigResourceCondition(String configSystemProperty, String... resourceLocations) { super("Hazelcast", HAZELCAST_CONFIG_PROPERTY, resourceLocations); - Assert.notNull(configSystemProperty, "ConfigSystemProperty must not be null"); + Assert.notNull(configSystemProperty, "'configSystemProperty' must not be null"); this.configSystemProperty = configSystemProperty; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java index be9d767d0f2..de88b4b0a36 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,8 +113,8 @@ public final class DefaultJmsListenerContainerFactoryConfigurer { * @param connectionFactory the {@link ConnectionFactory} to use */ public void configure(DefaultJmsListenerContainerFactory factory, ConnectionFactory connectionFactory) { - Assert.notNull(factory, "Factory must not be null"); - Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); + Assert.notNull(factory, "'factory' must not be null"); + Assert.notNull(connectionFactory, "'connectionFactory' must not be null"); JmsProperties.Listener listenerProperties = this.jmsProperties.getListener(); Session sessionProperties = listenerProperties.getSession(); factory.setConnectionFactory(connectionFactory); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfigurer.java index aa9c027540f..143ff15267a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ class ActiveMQConnectionFactoryConfigurer { ActiveMQConnectionFactoryConfigurer(ActiveMQProperties properties, List factoryCustomizers) { - Assert.notNull(properties, "Properties must not be null"); + Assert.notNull(properties, "'properties' must not be null"); this.properties = properties; this.factoryCustomizers = (factoryCustomizers != null) ? factoryCustomizers : Collections.emptyList(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryFactory.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryFactory.java index 957c17cc4b8..5fc00df65e3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryFactory.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,9 +53,9 @@ class ArtemisConnectionFactoryFactory { ArtemisConnectionFactoryFactory(ListableBeanFactory beanFactory, ArtemisProperties properties, ArtemisConnectionDetails connectionDetails) { - Assert.notNull(beanFactory, "BeanFactory must not be null"); - Assert.notNull(properties, "Properties must not be null"); - Assert.notNull(connectionDetails, "ConnectionDetails must not be null"); + Assert.notNull(beanFactory, "'beanFactory' must not be null"); + Assert.notNull(properties, "'properties' must not be null"); + Assert.notNull(connectionDetails, "'connectionDetails' must not be null"); this.beanFactory = beanFactory; this.properties = properties; this.connectionDetails = connectionDetails; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/DefaultExceptionTranslatorExecuteListener.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/DefaultExceptionTranslatorExecuteListener.java index 199a62dda0e..c6d67c7a7c3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/DefaultExceptionTranslatorExecuteListener.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/DefaultExceptionTranslatorExecuteListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ final class DefaultExceptionTranslatorExecuteListener implements ExceptionTransl private DefaultExceptionTranslatorExecuteListener(Log logger, Function translatorFactory) { - Assert.notNull(translatorFactory, "TranslatorFactory must not be null"); + Assert.notNull(translatorFactory, "'translatorFactory' must not be null"); this.logger = logger; this.translatorFactory = translatorFactory; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java index ec59ac43bc2..dfbeb72350f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/LdapProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -125,7 +125,7 @@ public class LdapProperties { } private int determinePort(Environment environment) { - Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(environment, "'environment' must not be null"); String localPort = environment.getProperty("local.ldap.port"); if (localPort != null) { return Integer.parseInt(localPort); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java index 7d1df833225..0746aa6d6f5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -159,7 +159,7 @@ public class LiquibaseProperties { } public void setChangeLog(String changeLog) { - Assert.notNull(changeLog, "ChangeLog must not be null"); + Assert.notNull(changeLog, "'changeLog' must not be null"); this.changeLog = changeLog; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLogger.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLogger.java index 1af820991ab..4cd8e566ce0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLogger.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLogger.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,13 +43,13 @@ class ConditionEvaluationReportLogger { private final LogLevel logLevel; ConditionEvaluationReportLogger(LogLevel logLevel, Supplier reportSupplier) { - Assert.isTrue(isInfoOrDebug(logLevel), "LogLevel must be INFO or DEBUG"); + Assert.isTrue(isInfoOrDebug(logLevel), "'logLevel' must be INFO or DEBUG"); this.logLevel = logLevel; this.reportSupplier = reportSupplier; } - private boolean isInfoOrDebug(LogLevel logLevelForReport) { - return LogLevel.INFO.equals(logLevelForReport) || LogLevel.DEBUG.equals(logLevelForReport); + private boolean isInfoOrDebug(LogLevel logLevel) { + return LogLevel.INFO.equals(logLevel) || LogLevel.DEBUG.equals(logLevel); } void logReport(boolean isCrashReport) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java index 31bcac1d4f5..d2de269fbe9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,15 +50,15 @@ import org.springframework.util.Assert; public class ConditionEvaluationReportLoggingListener implements ApplicationContextInitializer { - private final LogLevel logLevelForReport; + private final LogLevel logLevel; public ConditionEvaluationReportLoggingListener() { this(LogLevel.DEBUG); } - private ConditionEvaluationReportLoggingListener(LogLevel logLevelForReport) { - Assert.isTrue(isInfoOrDebug(logLevelForReport), "LogLevel must be INFO or DEBUG"); - this.logLevelForReport = logLevelForReport; + private ConditionEvaluationReportLoggingListener(LogLevel logLevel) { + Assert.isTrue(isInfoOrDebug(logLevel), "'logLevel' must be INFO or DEBUG"); + this.logLevel = logLevel; } private boolean isInfoOrDebug(LogLevel logLevelForReport) { @@ -100,8 +100,8 @@ public class ConditionEvaluationReportLoggingListener else { reportSupplier = this::getReport; } - this.logger = new ConditionEvaluationReportLogger( - ConditionEvaluationReportLoggingListener.this.logLevelForReport, reportSupplier); + this.logger = new ConditionEvaluationReportLogger(ConditionEvaluationReportLoggingListener.this.logLevel, + reportSupplier); } private ConditionEvaluationReport getReport() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java index c01450b1e55..648ffd9c834 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,8 +77,8 @@ public class HibernateProperties { */ public Map determineHibernateProperties(Map jpaProperties, HibernateSettings settings) { - Assert.notNull(jpaProperties, "JpaProperties must not be null"); - Assert.notNull(settings, "Settings must not be null"); + Assert.notNull(jpaProperties, "'jpaProperties' must not be null"); + Assert.notNull(settings, "'settings' must not be null"); return getAdditionalProperties(jpaProperties, settings); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarProperties.java index 3972eec5029..5ab34e4acfa 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -292,9 +292,9 @@ public class PulsarProperties { public record TypeMapping(Class messageType, String topicName, SchemaInfo schemaInfo) { public TypeMapping { - Assert.notNull(messageType, "messageType must not be null"); + Assert.notNull(messageType, "'messageType' must not be null"); Assert.isTrue(topicName != null || schemaInfo != null, - "At least one of topicName or schemaInfo must not be null"); + "At least one of 'topicName' or 'schemaInfo' must not be null"); } } @@ -309,10 +309,10 @@ public class PulsarProperties { public record SchemaInfo(SchemaType schemaType, Class messageKeyType) { public SchemaInfo { - Assert.notNull(schemaType, "schemaType must not be null"); - Assert.isTrue(schemaType != SchemaType.NONE, "schemaType 'NONE' not supported"); + Assert.notNull(schemaType, "'schemaType' must not be null"); + Assert.isTrue(schemaType != SchemaType.NONE, "'schemaType' must not be NONE"); Assert.isTrue(messageKeyType == null || schemaType == SchemaType.KEY_VALUE, - "messageKeyType can only be set when schemaType is KEY_VALUE"); + "'messageKeyType' can only be set when 'schemaType' is KEY_VALUE"); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java index f974fbbacfe..ff57def944a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,6 @@ import java.util.List; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.source.InvalidConfigurationPropertyValueException; import org.springframework.core.io.Resource; -import org.springframework.util.Assert; import org.springframework.util.StreamUtils; /** @@ -175,7 +174,10 @@ public class OAuth2ResourceServerProperties { public String readPublicKey() throws IOException { String key = "spring.security.oauth2.resourceserver.public-key-location"; - Assert.notNull(this.publicKeyLocation, "PublicKeyLocation must not be null"); + if (this.publicKeyLocation == null) { + throw new InvalidConfigurationPropertyValueException(key, this.publicKeyLocation, + "No public key location specified"); + } if (!this.publicKeyLocation.exists()) { throw new InvalidConfigurationPropertyValueException(key, this.publicKeyLocation, "Public key location does not exist"); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java index 7d95c338c32..9f9321c047d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,7 +81,7 @@ public final class StaticResourceRequest { * @return the configured {@link ServerWebExchangeMatcher} */ public StaticResourceServerWebExchange at(Set locations) { - Assert.notNull(locations, "Locations must not be null"); + Assert.notNull(locations, "'locations' must not be null"); return new StaticResourceServerWebExchange(new LinkedHashSet<>(locations)); } @@ -115,7 +115,7 @@ public final class StaticResourceRequest { * @return a new {@link StaticResourceServerWebExchange} */ public StaticResourceServerWebExchange excluding(Set locations) { - Assert.notNull(locations, "Locations must not be null"); + Assert.notNull(locations, "'locations' must not be null"); Set subset = new LinkedHashSet<>(this.locations); subset.removeAll(locations); return new StaticResourceServerWebExchange(subset); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java index 13d6cf92681..ef8a72bc5cd 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,7 +86,7 @@ public final class StaticResourceRequest { * @return the configured {@link RequestMatcher} */ public StaticResourceRequestMatcher at(Set locations) { - Assert.notNull(locations, "Locations must not be null"); + Assert.notNull(locations, "'locations' must not be null"); return new StaticResourceRequestMatcher(new LinkedHashSet<>(locations)); } @@ -124,7 +124,7 @@ public final class StaticResourceRequest { * @return a new {@link StaticResourceRequestMatcher} */ public StaticResourceRequestMatcher excluding(Set locations) { - Assert.notNull(locations, "Locations must not be null"); + Assert.notNull(locations, "'locations' must not be null"); Set subset = new LinkedHashSet<>(this.locations); subset.removeAll(locations); return new StaticResourceRequestMatcher(subset); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/CertificateMatcher.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/CertificateMatcher.java index c7b527b00f3..49604a466fc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/CertificateMatcher.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/CertificateMatcher.java @@ -50,7 +50,7 @@ class CertificateMatcher { private final byte[] generatedSignature; CertificateMatcher(PrivateKey privateKey) { - Assert.notNull(privateKey, "Private key must not be null"); + Assert.notNull(privateKey, "'privateKey' must not be null"); this.privateKey = privateKey; this.signature = createSignature(privateKey); Assert.state(this.signature != null, "Failed to create signature"); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/FileWatcher.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/FileWatcher.java index 5ffcdbc8335..f96d2a89e26 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/FileWatcher.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/FileWatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,7 +65,7 @@ class FileWatcher implements Closeable { * actions */ FileWatcher(Duration quietPeriod) { - Assert.notNull(quietPeriod, "QuietPeriod must not be null"); + Assert.notNull(quietPeriod, "'quietPeriod' must not be null"); this.quietPeriod = quietPeriod; } @@ -75,8 +75,8 @@ class FileWatcher implements Closeable { * @param action the action to take when changes are detected */ void watch(Set paths, Runnable action) { - Assert.notNull(paths, "Paths must not be null"); - Assert.notNull(action, "Action must not be null"); + Assert.notNull(paths, "'paths' must not be null"); + Assert.notNull(action, "'action' must not be null"); if (paths.isEmpty()) { return; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java index f6e2d678fb0..d20aff3900e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProviders.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,7 @@ public class TemplateAvailabilityProviders { * @param classLoader the source class loader */ public TemplateAvailabilityProviders(ClassLoader classLoader) { - Assert.notNull(classLoader, "ClassLoader must not be null"); + Assert.notNull(classLoader, "'classLoader' must not be null"); this.providers = SpringFactoriesLoader.loadFactories(TemplateAvailabilityProvider.class, classLoader); } @@ -89,7 +89,7 @@ public class TemplateAvailabilityProviders { * @param providers the underlying providers */ protected TemplateAvailabilityProviders(Collection providers) { - Assert.notNull(providers, "Providers must not be null"); + Assert.notNull(providers, "'providers' must not be null"); this.providers = new ArrayList<>(providers); } @@ -108,7 +108,7 @@ public class TemplateAvailabilityProviders { * @return a {@link TemplateAvailabilityProvider} or null */ public TemplateAvailabilityProvider getProvider(String view, ApplicationContext applicationContext) { - Assert.notNull(applicationContext, "ApplicationContext must not be null"); + Assert.notNull(applicationContext, "'applicationContext' must not be null"); return getProvider(view, applicationContext.getEnvironment(), applicationContext.getClassLoader(), applicationContext); } @@ -123,10 +123,10 @@ public class TemplateAvailabilityProviders { */ public TemplateAvailabilityProvider getProvider(String view, Environment environment, ClassLoader classLoader, ResourceLoader resourceLoader) { - Assert.notNull(view, "View must not be null"); - Assert.notNull(environment, "Environment must not be null"); - Assert.notNull(classLoader, "ClassLoader must not be null"); - Assert.notNull(resourceLoader, "ResourceLoader must not be null"); + Assert.notNull(view, "'view' must not be null"); + Assert.notNull(environment, "'environment' must not be null"); + Assert.notNull(classLoader, "'classLoader' must not be null"); + Assert.notNull(resourceLoader, "'resourceLoader' must not be null"); Boolean useCache = environment.getProperty("spring.template.provider.cache", Boolean.class, true); if (!useCache) { return findProvider(view, environment, classLoader, resourceLoader); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateLocation.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateLocation.java index 90dd2caf135..a5adcc4881e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateLocation.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/template/TemplateLocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public class TemplateLocation { private final String path; public TemplateLocation(String path) { - Assert.notNull(path, "Path must not be null"); + Assert.notNull(path, "'path' must not be null"); this.path = path; } @@ -45,7 +45,7 @@ public class TemplateLocation { * @return {@code true} if the location exists. */ public boolean exists(ResourcePatternResolver resolver) { - Assert.notNull(resolver, "Resolver must not be null"); + Assert.notNull(resolver, "'resolver' must not be null"); if (resolver.getResource(this.path).exists()) { return true; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/client/HttpMessageConvertersRestClientCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/client/HttpMessageConvertersRestClientCustomizer.java index c5372d5d7f8..0ee1099edd6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/client/HttpMessageConvertersRestClientCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/client/HttpMessageConvertersRestClientCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public class HttpMessageConvertersRestClientCustomizer implements RestClientCust private final Iterable> messageConverters; public HttpMessageConvertersRestClientCustomizer(HttpMessageConverter... messageConverters) { - Assert.notNull(messageConverters, "MessageConverters must not be null"); + Assert.notNull(messageConverters, "'messageConverters' must not be null"); this.messageConverters = Arrays.asList(messageConverters); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java index c601654d0e4..c7315504d59 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,9 +85,9 @@ public abstract class AbstractErrorWebExceptionHandler implements ErrorWebExcept */ public AbstractErrorWebExceptionHandler(ErrorAttributes errorAttributes, Resources resources, ApplicationContext applicationContext) { - Assert.notNull(errorAttributes, "ErrorAttributes must not be null"); - Assert.notNull(resources, "Resources must not be null"); - Assert.notNull(applicationContext, "ApplicationContext must not be null"); + Assert.notNull(errorAttributes, "'errorAttributes' must not be null"); + Assert.notNull(resources, "'resources' must not be null"); + Assert.notNull(applicationContext, "'applicationContext' must not be null"); this.errorAttributes = errorAttributes; this.resources = resources; this.applicationContext = applicationContext; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ReactorNettyHttpClientMapper.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ReactorNettyHttpClientMapper.java index 2589b002d51..0134ed8976e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ReactorNettyHttpClientMapper.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ReactorNettyHttpClientMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public interface ReactorNettyHttpClientMapper { * @since 3.1.1 */ static ReactorNettyHttpClientMapper of(Collection mappers) { - Assert.notNull(mappers, "Mappers must not be null"); + Assert.notNull(mappers, "'mappers' must not be null"); return of(mappers.toArray(ReactorNettyHttpClientMapper[]::new)); } @@ -59,7 +59,7 @@ public interface ReactorNettyHttpClientMapper { * @since 3.1.1 */ static ReactorNettyHttpClientMapper of(ReactorNettyHttpClientMapper... mappers) { - Assert.notNull(mappers, "Mappers must not be null"); + Assert.notNull(mappers, "'mappers' must not be null"); return (httpClient) -> { for (ReactorNettyHttpClientMapper mapper : mappers) { httpClient = mapper.configure(httpClient); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletRegistrationBean.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletRegistrationBean.java index 9c6625cfe99..3eccf8887cf 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletRegistrationBean.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletRegistrationBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ public class DispatcherServletRegistrationBean extends ServletRegistrationBean errorViewResolvers) { - Assert.notNull(errorAttributes, "ErrorAttributes must not be null"); + Assert.notNull(errorAttributes, "'errorAttributes' must not be null"); this.errorAttributes = errorAttributes; this.errorViewResolvers = sortErrorViewResolvers(errorViewResolvers); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java index add6851f2ec..4a082f2ec35 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/error/BasicErrorController.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ public class BasicErrorController extends AbstractErrorController { public BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties, List errorViewResolvers) { super(errorAttributes, errorViewResolvers); - Assert.notNull(errorProperties, "ErrorProperties must not be null"); + Assert.notNull(errorProperties, "'errorProperties' must not be null"); this.errorProperties = errorProperties; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesProperties.java index 9f1014b4c7f..ab473fab16e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,9 +44,9 @@ public class WebServicesProperties { } public void setPath(String path) { - Assert.notNull(path, "Path must not be null"); - Assert.isTrue(path.length() > 1, "Path must have length greater than 1"); - Assert.isTrue(path.startsWith("/"), "Path must start with '/'"); + Assert.notNull(path, "'path' must not be null"); + Assert.isTrue(path.length() > 1, "'path' must have length greater than 1"); + Assert.isTrue(path.startsWith("/"), "'path' must start with '/'"); this.path = path; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index b29f64cce6c..e55f864f267 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -448,7 +448,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { "spring.cache.jcache.config=" + configLocation) .run((context) -> assertThat(context).getFailure() .isInstanceOf(BeanCreationException.class) - .hasMessageContaining("does not exist") + .hasMessageContaining("must exist") .hasMessageContaining(configLocation)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java index 0289be2ee95..ce789779fdb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScanPackagesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,7 @@ class EntityScanPackagesTests { @Test void registerFromArrayWhenRegistryIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> EntityScanPackages.register(null)) - .withMessageContaining("Registry must not be null"); + .withMessageContaining("'registry' must not be null"); } @@ -78,14 +78,14 @@ class EntityScanPackagesTests { this.context = new AnnotationConfigApplicationContext(); assertThatIllegalArgumentException() .isThrownBy(() -> EntityScanPackages.register(this.context, (String[]) null)) - .withMessageContaining("PackageNames must not be null"); + .withMessageContaining("'packageNames' must not be null"); } @Test void registerFromCollectionWhenRegistryIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> EntityScanPackages.register(null, Collections.emptyList())) - .withMessageContaining("Registry must not be null"); + .withMessageContaining("'registry' must not be null"); } @Test @@ -93,7 +93,7 @@ class EntityScanPackagesTests { this.context = new AnnotationConfigApplicationContext(); assertThatIllegalArgumentException() .isThrownBy(() -> EntityScanPackages.register(this.context, (Collection) null)) - .withMessageContaining("PackageNames must not be null"); + .withMessageContaining("'packageNames' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScannerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScannerTests.java index ec707d9c838..6c3a99c47b6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScannerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/domain/EntityScannerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class EntityScannerTests { @Test void createWhenContextIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new EntityScanner(null)) - .withMessageContaining("Context must not be null"); + .withMessageContaining("'context' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/h2/H2ConsolePropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/h2/H2ConsolePropertiesTests.java index e60e6abcfa7..bebfd11bf91 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/h2/H2ConsolePropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/h2/H2ConsolePropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,21 +31,21 @@ class H2ConsolePropertiesTests { void pathMustNotBeEmpty() { H2ConsoleProperties properties = new H2ConsoleProperties(); assertThatIllegalArgumentException().isThrownBy(() -> properties.setPath("")) - .withMessageContaining("Path must have length greater than 1"); + .withMessageContaining("'path' must have length greater than 1"); } @Test void pathMustHaveLengthGreaterThanOne() { H2ConsoleProperties properties = new H2ConsoleProperties(); assertThatIllegalArgumentException().isThrownBy(() -> properties.setPath("/")) - .withMessageContaining("Path must have length greater than 1"); + .withMessageContaining("'path' must have length greater than 1"); } @Test void customPathMustBeginWithASlash() { H2ConsoleProperties properties = new H2ConsoleProperties(); assertThatIllegalArgumentException().isThrownBy(() -> properties.setPath("custom")) - .withMessageContaining("Path must start with '/'"); + .withMessageContaining("'path' must start with '/'"); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/DefaultExceptionTranslatorExecuteListenerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/DefaultExceptionTranslatorExecuteListenerTests.java index ae1278889d1..c4c36b20ff8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/DefaultExceptionTranslatorExecuteListenerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/DefaultExceptionTranslatorExecuteListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class DefaultExceptionTranslatorExecuteListenerTests { assertThatIllegalArgumentException() .isThrownBy(() -> new DefaultExceptionTranslatorExecuteListener( (Function) null)) - .withMessage("TranslatorFactory must not be null"); + .withMessage("'translatorFactory' must not be null"); } @ParameterizedTest(name = "{0}") diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggerTests.java index c728158876e..47680a6e04b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class ConditionEvaluationReportLoggerTests { void supportsOnlyInfoAndDebugLogLevels() { assertThatIllegalArgumentException() .isThrownBy(() -> new ConditionEvaluationReportLogger(LogLevel.TRACE, () -> null)) - .withMessageContaining("LogLevel must be INFO or DEBUG"); + .withMessageContaining("'logLevel' must be INFO or DEBUG"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarPropertiesTests.java index 72fbdd0e73f..cfaff0ccd02 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -226,7 +226,7 @@ class PulsarPropertiesTests { map.put("spring.pulsar.defaults.type-mappings[0].schema-info.message-key-type", String.class.getName()); assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindProperties(map)) .havingRootCause() - .withMessageContaining("schemaType must not be null"); + .withMessageContaining("'schemaType' must not be null"); } @Test @@ -236,7 +236,7 @@ class PulsarPropertiesTests { map.put("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type", "NONE"); assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindProperties(map)) .havingRootCause() - .withMessageContaining("schemaType 'NONE' not supported"); + .withMessageContaining("'schemaType' must not be NONE"); } @Test @@ -247,7 +247,7 @@ class PulsarPropertiesTests { map.put("spring.pulsar.defaults.type-mappings[0].schema-info.message-key-type", String.class.getName()); assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindProperties(map)) .havingRootCause() - .withMessageContaining("messageKeyType can only be set when schemaType is KEY_VALUE"); + .withMessageContaining("'messageKeyType' can only be set when 'schemaType' is KEY_VALUE"); } record TestMessage(String value) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java index db501b62ae4..0b2f0957d36 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,13 +78,13 @@ class StaticResourceRequestTests { @Test void atLocationsFromSetWhenSetIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> this.resourceRequest.at(null)) - .withMessageContaining("Locations must not be null"); + .withMessageContaining("'locations' must not be null"); } @Test void excludeFromSetWhenSetIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> this.resourceRequest.atCommonLocations().excluding(null)) - .withMessageContaining("Locations must not be null"); + .withMessageContaining("'locations' must not be null"); } private RequestMatcherAssert assertMatcher(ServerWebExchangeMatcher matcher) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java index e99120b3eed..7f2fe7869d0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,13 +87,13 @@ class StaticResourceRequestTests { @Test void atLocationsFromSetWhenSetIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> this.resourceRequest.at(null)) - .withMessageContaining("Locations must not be null"); + .withMessageContaining("'locations' must not be null"); } @Test void excludeFromSetWhenSetIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> this.resourceRequest.atCommonLocations().excluding(null)) - .withMessageContaining("Locations must not be null"); + .withMessageContaining("'locations' must not be null"); } private RequestMatcherAssert assertMatcher(RequestMatcher matcher) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java index 48cc8cb8c57..4591a1d3eca 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +67,7 @@ class TemplateAvailabilityProvidersTests { void createWhenApplicationContextIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new TemplateAvailabilityProviders((ApplicationContext) null)) - .withMessageContaining("ClassLoader must not be null"); + .withMessageContaining("'classLoader' must not be null"); } @Test @@ -82,7 +82,7 @@ class TemplateAvailabilityProvidersTests { @Test void createWhenClassLoaderIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new TemplateAvailabilityProviders((ClassLoader) null)) - .withMessageContaining("ClassLoader must not be null"); + .withMessageContaining("'classLoader' must not be null"); } @Test @@ -95,7 +95,7 @@ class TemplateAvailabilityProvidersTests { void createWhenProvidersIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new TemplateAvailabilityProviders((Collection) null)) - .withMessageContaining("Providers must not be null"); + .withMessageContaining("'providers' must not be null"); } @Test @@ -108,35 +108,35 @@ class TemplateAvailabilityProvidersTests { @Test void getProviderWhenApplicationContextIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> this.providers.getProvider(this.view, null)) - .withMessageContaining("ApplicationContext must not be null"); + .withMessageContaining("'applicationContext' must not be null"); } @Test void getProviderWhenViewIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.providers.getProvider(null, this.environment, this.classLoader, this.resourceLoader)) - .withMessageContaining("View must not be null"); + .withMessageContaining("'view' must not be null"); } @Test void getProviderWhenEnvironmentIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.providers.getProvider(this.view, null, this.classLoader, this.resourceLoader)) - .withMessageContaining("Environment must not be null"); + .withMessageContaining("'environment' must not be null"); } @Test void getProviderWhenClassLoaderIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.providers.getProvider(this.view, this.environment, null, this.resourceLoader)) - .withMessageContaining("ClassLoader must not be null"); + .withMessageContaining("'classLoader' must not be null"); } @Test void getProviderWhenResourceLoaderIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.providers.getProvider(this.view, this.environment, this.classLoader, null)) - .withMessageContaining("ResourceLoader must not be null"); + .withMessageContaining("'resourceLoader' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/client/HttpMessageConvertersRestClientCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/client/HttpMessageConvertersRestClientCustomizerTests.java index f4138baa181..cf7c02fdbe8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/client/HttpMessageConvertersRestClientCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/client/HttpMessageConvertersRestClientCustomizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ class HttpMessageConvertersRestClientCustomizerTests { void createWhenNullMessageConvertersArrayThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> new HttpMessageConvertersRestClientCustomizer((HttpMessageConverter[]) null)) - .withMessage("MessageConverters must not be null"); + .withMessage("'messageConverters' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ReactorNettyHttpClientMapperTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ReactorNettyHttpClientMapperTests.java index a49c95a6f4a..ff13a15f22b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ReactorNettyHttpClientMapperTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ReactorNettyHttpClientMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ class ReactorNettyHttpClientMapperTests { void ofWhenCollectionIsNullThrowsException() { Collection mappers = null; assertThatIllegalArgumentException().isThrownBy(() -> ReactorNettyHttpClientMapper.of(mappers)) - .withMessage("Mappers must not be null"); + .withMessage("'mappers' must not be null"); } @Test @@ -64,7 +64,7 @@ class ReactorNettyHttpClientMapperTests { void ofWhenArrayIsNullThrowsException() { ReactorNettyHttpClientMapper[] mappers = null; assertThatIllegalArgumentException().isThrownBy(() -> ReactorNettyHttpClientMapper.of(mappers)) - .withMessage("Mappers must not be null"); + .withMessage("'mappers' must not be null"); } private static class TestHttpClient extends HttpClient { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletRegistrationBeanTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletRegistrationBeanTests.java index 6fef92dd72f..8eec73005f8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletRegistrationBeanTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletRegistrationBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ class DispatcherServletRegistrationBeanTests { void createWhenPathIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> new DispatcherServletRegistrationBean(new DispatcherServlet(), null)) - .withMessageContaining("Path must not be null"); + .withMessageContaining("'path' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java index 5b7a014bd11..c4d129ce7be 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ class WebMvcPropertiesTests { void servletPathWhenHasWildcardThrowsException() { assertThatExceptionOfType(BindException.class).isThrownBy(() -> bind("spring.mvc.servlet.path", "/*")) .withRootCauseInstanceOf(IllegalArgumentException.class) - .satisfies((ex) -> assertThat(Throwables.getRootCause(ex)).hasMessage("Path must not contain wildcards")); + .satisfies((ex) -> assertThat(Throwables.getRootCause(ex)).hasMessage("'path' must not contain wildcards")); } private void bind(String name, String value) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java index 89aed095a37..deb19e1a027 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ class WebServicesAutoConfigurationTests { .run((context) -> assertThat(context).getFailure() .isInstanceOf(BeanCreationException.class) .rootCause() - .hasMessageContaining("Path must start with '/'")); + .hasMessageContaining("'path' must start with '/'")); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesPropertiesTests.java index c1450a1f46c..4b94b53c729 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/webservices/WebServicesPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,21 +33,21 @@ class WebServicesPropertiesTests { void pathMustNotBeEmpty() { this.properties = new WebServicesProperties(); assertThatIllegalArgumentException().isThrownBy(() -> this.properties.setPath("")) - .withMessageContaining("Path must have length greater than 1"); + .withMessageContaining("'path' must have length greater than 1"); } @Test void pathMustHaveLengthGreaterThanOne() { this.properties = new WebServicesProperties(); assertThatIllegalArgumentException().isThrownBy(() -> this.properties.setPath("/")) - .withMessageContaining("Path must have length greater than 1"); + .withMessageContaining("'path' must have length greater than 1"); } @Test void customPathMustBeginWithASlash() { this.properties = new WebServicesProperties(); assertThatIllegalArgumentException().isThrownBy(() -> this.properties.setPath("custom")) - .withMessageContaining("Path must start with '/'"); + .withMessageContaining("'path' must start with '/'"); } } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilter.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilter.java index d4f197d00b0..1b78252d414 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilter.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ public class TriggerFileFilter implements FileFilter { private final String name; public TriggerFileFilter(String name) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); this.name = name; } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathChangedEvent.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathChangedEvent.java index b08ce3beff0..5d5c09ebf44 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathChangedEvent.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathChangedEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ public class ClassPathChangedEvent extends ApplicationEvent { */ public ClassPathChangedEvent(Object source, Set changeSet, boolean restartRequired) { super(source); - Assert.notNull(changeSet, "ChangeSet must not be null"); + Assert.notNull(changeSet, "'changeSet' must not be null"); this.changeSet = changeSet; this.restartRequired = restartRequired; } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListener.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListener.java index d8d7d0c5b87..866992a0e4b 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListener.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,8 +50,8 @@ class ClassPathFileChangeListener implements FileChangeListener { */ ClassPathFileChangeListener(ApplicationEventPublisher eventPublisher, ClassPathRestartStrategy restartStrategy, FileSystemWatcher fileSystemWatcherToStop) { - Assert.notNull(eventPublisher, "EventPublisher must not be null"); - Assert.notNull(restartStrategy, "RestartStrategy must not be null"); + Assert.notNull(eventPublisher, "'eventPublisher' must not be null"); + Assert.notNull(restartStrategy, "'restartStrategy' must not be null"); this.eventPublisher = eventPublisher; this.restartStrategy = restartStrategy; this.fileSystemWatcherToStop = fileSystemWatcherToStop; diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcher.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcher.java index bf70e37d12a..f78413dadf4 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcher.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,8 +54,8 @@ public class ClassPathFileSystemWatcher implements InitializingBean, DisposableB */ public ClassPathFileSystemWatcher(FileSystemWatcherFactory fileSystemWatcherFactory, ClassPathRestartStrategy restartStrategy, URL[] urls) { - Assert.notNull(fileSystemWatcherFactory, "FileSystemWatcherFactory must not be null"); - Assert.notNull(urls, "Urls must not be null"); + Assert.notNull(fileSystemWatcherFactory, "'fileSystemWatcherFactory' must not be null"); + Assert.notNull(urls, "'urls' must not be null"); this.fileSystemWatcher = fileSystemWatcherFactory.getFileSystemWatcher(); this.restartStrategy = restartStrategy; this.fileSystemWatcher.addSourceDirectories(new ClassPathDirectories(urls)); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/ChangedFile.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/ChangedFile.java index f4cae7d659a..1313c456db5 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/ChangedFile.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/ChangedFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,9 +43,9 @@ public final class ChangedFile { * @param type the type of change */ public ChangedFile(File sourceDirectory, File file, Type type) { - Assert.notNull(sourceDirectory, "SourceDirectory must not be null"); - Assert.notNull(file, "File must not be null"); - Assert.notNull(type, "Type must not be null"); + Assert.notNull(sourceDirectory, "'sourceDirectory' must not be null"); + Assert.notNull(file, "'file' must not be null"); + Assert.notNull(type, "'type' must not be null"); this.sourceDirectory = sourceDirectory; this.file = file; this.type = type; diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/DirectorySnapshot.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/DirectorySnapshot.java index 899714d82a3..20a54763709 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/DirectorySnapshot.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/DirectorySnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,8 +50,8 @@ class DirectorySnapshot { * @param directory the source directory */ DirectorySnapshot(File directory) { - Assert.notNull(directory, "Directory must not be null"); - Assert.isTrue(!directory.isFile(), () -> "Directory '" + directory + "' must not be a file"); + Assert.notNull(directory, "'directory' must not be null"); + Assert.isTrue(!directory.isFile(), () -> "'directory' [%s] must not be a file".formatted(directory)); this.directory = directory; this.time = new Date(); Set files = new LinkedHashSet<>(); @@ -74,10 +74,10 @@ class DirectorySnapshot { } ChangedFiles getChangedFiles(DirectorySnapshot snapshot, FileFilter triggerFilter) { - Assert.notNull(snapshot, "Snapshot must not be null"); + Assert.notNull(snapshot, "'snapshot' must not be null"); File directory = this.directory; Assert.isTrue(snapshot.directory.equals(directory), - () -> "Snapshot source directory must be '" + directory + "'"); + () -> "'snapshot' source directory must be '" + directory + "'"); Set changes = new LinkedHashSet<>(); Map previousFiles = getFilesMap(); for (FileSnapshot currentFile : snapshot.files) { diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSnapshot.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSnapshot.java index ef29927d11f..1954c8718cb 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSnapshot.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,8 +36,8 @@ class FileSnapshot { private final long lastModified; FileSnapshot(File file) { - Assert.notNull(file, "File must not be null"); - Assert.isTrue(file.isFile() || !file.exists(), "File must not be a directory"); + Assert.notNull(file, "'file' must not be null"); + Assert.isTrue(file.isFile() || !file.exists(), () -> "'file' [%s] must be a normal file".formatted(file)); this.file = file; this.exists = file.exists(); this.length = file.length(); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java index 35a950c6e3b..876a5bb2179 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,12 +95,12 @@ public class FileSystemWatcher { */ public FileSystemWatcher(boolean daemon, Duration pollInterval, Duration quietPeriod, SnapshotStateRepository snapshotStateRepository) { - Assert.notNull(pollInterval, "PollInterval must not be null"); - Assert.notNull(quietPeriod, "QuietPeriod must not be null"); - Assert.isTrue(pollInterval.toMillis() > 0, "PollInterval must be positive"); - Assert.isTrue(quietPeriod.toMillis() > 0, "QuietPeriod must be positive"); + Assert.notNull(pollInterval, "'pollInterval' must not be null"); + Assert.notNull(quietPeriod, "'quietPeriod' must not be null"); + Assert.isTrue(pollInterval.toMillis() > 0, "'pollInterval' must be positive"); + Assert.isTrue(quietPeriod.toMillis() > 0, "'quietPeriod' must be positive"); Assert.isTrue(pollInterval.toMillis() > quietPeriod.toMillis(), - "PollInterval must be greater than QuietPeriod"); + "'pollInterval' must be greater than QuietPeriod"); this.daemon = daemon; this.pollInterval = pollInterval.toMillis(); this.quietPeriod = quietPeriod.toMillis(); @@ -114,7 +114,7 @@ public class FileSystemWatcher { * @param fileChangeListener the listener to add */ public void addListener(FileChangeListener fileChangeListener) { - Assert.notNull(fileChangeListener, "FileChangeListener must not be null"); + Assert.notNull(fileChangeListener, "'fileChangeListener' must not be null"); synchronized (this.monitor) { checkNotStarted(); this.listeners.add(fileChangeListener); @@ -127,7 +127,7 @@ public class FileSystemWatcher { * @param directories the directories to monitor */ public void addSourceDirectories(Iterable directories) { - Assert.notNull(directories, "Directories must not be null"); + Assert.notNull(directories, "'directories' must not be null"); synchronized (this.monitor) { directories.forEach(this::addSourceDirectory); } @@ -139,8 +139,8 @@ public class FileSystemWatcher { * @param directory the directory to monitor */ public void addSourceDirectory(File directory) { - Assert.notNull(directory, "Directory must not be null"); - Assert.isTrue(!directory.isFile(), () -> "Directory '" + directory + "' must not be a file"); + Assert.notNull(directory, "'directory' must not be null"); + Assert.isTrue(!directory.isFile(), () -> "'directory' [%s] must not be a file".formatted(directory)); synchronized (this.monitor) { checkNotStarted(); this.directories.put(directory, null); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java index 786a14c42ff..61376ea7623 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,13 +40,13 @@ class Frame { * @param payload the text payload */ Frame(String payload) { - Assert.notNull(payload, "Payload must not be null"); + Assert.notNull(payload, "'payload' must not be null"); this.type = Type.TEXT; this.payload = payload.getBytes(); } Frame(Type type) { - Assert.notNull(type, "Type must not be null"); + Assert.notNull(type, "'type' must not be null"); this.type = type; this.payload = NO_BYTES; } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploader.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploader.java index 44bf7d24d58..5f2fea3db0c 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploader.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploader.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,8 +76,8 @@ public class ClassPathChangeUploader implements ApplicationListener mappers; public Dispatcher(AccessManager accessManager, Collection mappers) { - Assert.notNull(accessManager, "AccessManager must not be null"); - Assert.notNull(mappers, "Mappers must not be null"); + Assert.notNull(accessManager, "'accessManager' must not be null"); + Assert.notNull(mappers, "'mappers' must not be null"); this.accessManager = accessManager; this.mappers = new ArrayList<>(mappers); AnnotationAwareOrderComparator.sort(this.mappers); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/DispatcherFilter.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/DispatcherFilter.java index 351f5689665..f8a2fa7db1e 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/DispatcherFilter.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/DispatcherFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ public class DispatcherFilter implements Filter { private final Dispatcher dispatcher; public DispatcherFilter(Dispatcher dispatcher) { - Assert.notNull(dispatcher, "Dispatcher must not be null"); + Assert.notNull(dispatcher, "'dispatcher' must not be null"); this.dispatcher = dispatcher; } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/HttpHeaderAccessManager.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/HttpHeaderAccessManager.java index c04366f8c6d..6c3a3d49966 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/HttpHeaderAccessManager.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/HttpHeaderAccessManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,8 +33,8 @@ public class HttpHeaderAccessManager implements AccessManager { private final String expectedSecret; public HttpHeaderAccessManager(String headerName, String expectedSecret) { - Assert.hasLength(headerName, "HeaderName must not be empty"); - Assert.hasLength(expectedSecret, "ExpectedSecret must not be empty"); + Assert.hasLength(headerName, "'headerName' must not be empty"); + Assert.hasLength(expectedSecret, "'expectedSecret' must not be empty"); this.headerName = headerName; this.expectedSecret = expectedSecret; } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapper.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapper.java index 3237ca00ba6..2bd1094ef32 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapper.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,8 +38,8 @@ public class UrlHandlerMapper implements HandlerMapper { * @param handler the handler to use */ public UrlHandlerMapper(String url, Handler handler) { - Assert.hasLength(url, "URL must not be empty"); - Assert.isTrue(url.startsWith("/"), "URL must start with '/'"); + Assert.hasLength(url, "'url' must not be empty"); + Assert.isTrue(url.startsWith("/"), "'url' must start with '/'"); this.requestUri = url; this.handler = handler; } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/MainMethod.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/MainMethod.java index 9f3767ae6b9..c02b2dc77fe 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/MainMethod.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/MainMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ class MainMethod { } MainMethod(Thread thread) { - Assert.notNull(thread, "Thread must not be null"); + Assert.notNull(thread, "'thread' must not be null"); this.method = getMainMethod(thread); } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java index 7580d03e7e5..16b1609060d 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java @@ -129,9 +129,9 @@ public class Restarter { * @see #initialize(String[]) */ protected Restarter(Thread thread, String[] args, boolean forceReferenceCleanup, RestartInitializer initializer) { - Assert.notNull(thread, "Thread must not be null"); - Assert.notNull(args, "Args must not be null"); - Assert.notNull(initializer, "Initializer must not be null"); + Assert.notNull(thread, "'thread' must not be null"); + Assert.notNull(args, "'args' must not be null"); + Assert.notNull(initializer, "'initializer' must not be null"); if (this.logger.isDebugEnabled()) { this.logger.debug("Creating new Restarter for thread " + thread); } @@ -208,7 +208,7 @@ public class Restarter { * @param urls the urls to add */ public void addUrls(Collection urls) { - Assert.notNull(urls, "Urls must not be null"); + Assert.notNull(urls, "'urls' must not be null"); this.urls.addAll(urls); } @@ -217,7 +217,7 @@ public class Restarter { * @param classLoaderFiles the files to add */ public void addClassLoaderFiles(ClassLoaderFiles classLoaderFiles) { - Assert.notNull(classLoaderFiles, "ClassLoaderFiles must not be null"); + Assert.notNull(classLoaderFiles, "'classLoaderFiles' must not be null"); this.classLoaderFiles.addAll(classLoaderFiles); } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java index 46df7df0d32..39b44b8d233 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,12 +54,12 @@ public class ClassLoaderFile implements Serializable { * @param contents the file contents */ public ClassLoaderFile(Kind kind, long lastModified, byte[] contents) { - Assert.notNull(kind, "Kind must not be null"); + Assert.notNull(kind, "'kind' must not be null"); if (kind == Kind.DELETED) { - Assert.isTrue(contents == null, "Contents must be null"); + Assert.isTrue(contents == null, "'contents' must be null"); } else { - Assert.isTrue(contents != null, "Contents must not be null"); + Assert.isTrue(contents != null, "'contents' must not be null"); } this.kind = kind; this.lastModified = lastModified; diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFiles.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFiles.java index 06e7d8f3f97..3d0c0708d9f 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFiles.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFiles.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable * @param classLoaderFiles the source classloader files. */ public ClassLoaderFiles(ClassLoaderFiles classLoaderFiles) { - Assert.notNull(classLoaderFiles, "ClassLoaderFiles must not be null"); + Assert.notNull(classLoaderFiles, "'classLoaderFiles' must not be null"); this.sourceDirectories = new LinkedHashMap<>(classLoaderFiles.sourceDirectories); } @@ -65,7 +65,7 @@ public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable * @param files the files to add */ public void addAll(ClassLoaderFiles files) { - Assert.notNull(files, "Files must not be null"); + Assert.notNull(files, "'files' must not be null"); for (SourceDirectory directory : files.getSourceDirectories()) { for (Map.Entry entry : directory.getFilesEntrySet()) { addFile(directory.getName(), entry.getKey(), entry.getValue()); @@ -89,9 +89,9 @@ public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable * @param file the file to add */ public void addFile(String sourceDirectory, String name, ClassLoaderFile file) { - Assert.notNull(sourceDirectory, "SourceDirectory must not be null"); - Assert.notNull(name, "Name must not be null"); - Assert.notNull(file, "File must not be null"); + Assert.notNull(sourceDirectory, "'sourceDirectory' must not be null"); + Assert.notNull(name, "'name' must not be null"); + Assert.notNull(file, "'file' must not be null"); removeAll(name); getOrCreateSourceDirectory(sourceDirectory).add(name, file); } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoader.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoader.java index 94f1a10143f..03599d099f8 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoader.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,8 +57,8 @@ public class RestartClassLoader extends URLClassLoader implements SmartClassLoad */ public RestartClassLoader(ClassLoader parent, URL[] urls, ClassLoaderFileRepository updatedFiles) { super(urls, parent); - Assert.notNull(parent, "Parent must not be null"); - Assert.notNull(updatedFiles, "UpdatedFiles must not be null"); + Assert.notNull(parent, "'parent' must not be null"); + Assert.notNull(updatedFiles, "'updatedFiles' must not be null"); this.updatedFiles = updatedFiles; } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/HttpRestartServer.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/HttpRestartServer.java index e2cbaeeac5b..5b2c99c5e1e 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/HttpRestartServer.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/HttpRestartServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public class HttpRestartServer { * the local classpath */ public HttpRestartServer(SourceDirectoryUrlFilter sourceDirectoryUrlFilter) { - Assert.notNull(sourceDirectoryUrlFilter, "SourceDirectoryUrlFilter must not be null"); + Assert.notNull(sourceDirectoryUrlFilter, "'sourceDirectoryUrlFilter' must not be null"); this.server = new RestartServer(sourceDirectoryUrlFilter); } @@ -57,7 +57,7 @@ public class HttpRestartServer { * @param restartServer the underlying restart server */ public HttpRestartServer(RestartServer restartServer) { - Assert.notNull(restartServer, "RestartServer must not be null"); + Assert.notNull(restartServer, "'restartServer' must not be null"); this.server = restartServer; } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/HttpRestartServerHandler.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/HttpRestartServerHandler.java index 66100c1f3df..d62dbf9d5e8 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/HttpRestartServerHandler.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/HttpRestartServerHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ public class HttpRestartServerHandler implements Handler { * @param server the server to adapt */ public HttpRestartServerHandler(HttpRestartServer server) { - Assert.notNull(server, "Server must not be null"); + Assert.notNull(server, "'server' must not be null"); this.server = server; } diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java index a88526fc8dc..c3cc42b62d9 100755 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/RestartServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,8 +68,8 @@ public class RestartServer { * @param classLoader the application classloader */ public RestartServer(SourceDirectoryUrlFilter sourceDirectoryUrlFilter, ClassLoader classLoader) { - Assert.notNull(sourceDirectoryUrlFilter, "SourceDirectoryUrlFilter must not be null"); - Assert.notNull(classLoader, "ClassLoader must not be null"); + Assert.notNull(sourceDirectoryUrlFilter, "'sourceDirectoryUrlFilter' must not be null"); + Assert.notNull(classLoader, "'classLoader' must not be null"); this.sourceDirectoryUrlFilter = sourceDirectoryUrlFilter; this.classLoader = classLoader; } diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilterTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilterTests.java index 458a5826d51..56d713291e3 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilterTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ class TriggerFileFilterTests { @Test void nameMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new TriggerFileFilter(null)) - .withMessageContaining("Name must not be null"); + .withMessageContaining("'name' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathChangedEventTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathChangedEventTests.java index ee62e930858..c4b78d9dda1 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathChangedEventTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathChangedEventTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ class ClassPathChangedEventTests { @Test void changeSetMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassPathChangedEvent(this.source, null, false)) - .withMessageContaining("ChangeSet must not be null"); + .withMessageContaining("'changeSet' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListenerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListenerTests.java index 29ae6eed8b5..8f0d5c0324b 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListenerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,14 +59,14 @@ class ClassPathFileChangeListenerTests { void eventPublisherMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new ClassPathFileChangeListener(null, this.restartStrategy, this.fileSystemWatcher)) - .withMessageContaining("EventPublisher must not be null"); + .withMessageContaining("'eventPublisher' must not be null"); } @Test void restartStrategyMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new ClassPathFileChangeListener(this.eventPublisher, null, this.fileSystemWatcher)) - .withMessageContaining("RestartStrategy must not be null"); + .withMessageContaining("'restartStrategy' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java index 877374e93dd..dd883fa3b19 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ class ClassPathFileSystemWatcherTests { assertThatIllegalArgumentException() .isThrownBy(() -> new ClassPathFileSystemWatcher(mock(FileSystemWatcherFactory.class), mock(ClassPathRestartStrategy.class), (URL[]) null)) - .withMessageContaining("Urls must not be null"); + .withMessageContaining("'urls' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java index 7a59b90c06d..dd827beea12 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,14 +40,14 @@ class ChangedFileTests { void sourceDirectoryMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new ChangedFile(null, new File(this.tempDir, "file"), Type.ADD)) - .withMessageContaining("SourceDirectory must not be null"); + .withMessageContaining("'sourceDirectory' must not be null"); } @Test void fileMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new ChangedFile(new File(this.tempDir, "directory"), null, Type.ADD)) - .withMessageContaining("File must not be null"); + .withMessageContaining("'file' must not be null"); } @Test @@ -55,7 +55,7 @@ class ChangedFileTests { assertThatIllegalArgumentException() .isThrownBy( () -> new ChangedFile(new File(this.tempDir, "file"), new File(this.tempDir, "directory"), null)) - .withMessageContaining("Type must not be null"); + .withMessageContaining("'type' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java index c4c52da7ceb..96e3a721bb4 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class DirectorySnapshotTests { @Test void directoryMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new DirectorySnapshot(null)) - .withMessageContaining("Directory must not be null"); + .withMessageContaining("'directory' must not be null"); } @Test @@ -61,7 +61,7 @@ class DirectorySnapshotTests { File file = new File(this.tempDir, "file"); file.createNewFile(); assertThatIllegalArgumentException().isThrownBy(() -> new DirectorySnapshot(file)) - .withMessageContaining("Directory '" + file + "' must not be a file"); + .withMessageContaining("'directory' [" + file + "] must not be a file"); } @Test @@ -103,14 +103,14 @@ class DirectorySnapshotTests { @Test void getChangedFilesSnapshotMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> this.initialSnapshot.getChangedFiles(null, null)) - .withMessageContaining("Snapshot must not be null"); + .withMessageContaining("'snapshot' must not be null"); } @Test void getChangedFilesSnapshotMustBeTheSameSourceDirectory() { assertThatIllegalArgumentException().isThrownBy( () -> this.initialSnapshot.getChangedFiles(new DirectorySnapshot(createTestDirectoryStructure()), null)) - .withMessageContaining("Snapshot source directory must be '" + this.directory + "'"); + .withMessageContaining("'snapshot' source directory must be '" + this.directory + "'"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java index 72705e1dd21..48588899f5a 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ class FileSnapshotTests { @Test void fileMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new FileSnapshot(null)) - .withMessageContaining("File must not be null"); + .withMessageContaining("'file' must not be null"); } @Test @@ -55,7 +55,7 @@ class FileSnapshotTests { File file = new File(this.tempDir, "file"); file.mkdir(); assertThatIllegalArgumentException().isThrownBy(() -> new FileSnapshot(file)) - .withMessageContaining("File must not be a directory"); + .withMessageContaining("'file' [" + file + "] must be a normal file"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java index 612850f90f6..c8b1c08e729 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,27 +64,27 @@ class FileSystemWatcherTests { void pollIntervalMustBePositive() { assertThatIllegalArgumentException() .isThrownBy(() -> new FileSystemWatcher(true, Duration.ofMillis(0), Duration.ofMillis(1))) - .withMessageContaining("PollInterval must be positive"); + .withMessageContaining("'pollInterval' must be positive"); } @Test void quietPeriodMustBePositive() { assertThatIllegalArgumentException() .isThrownBy(() -> new FileSystemWatcher(true, Duration.ofMillis(1), Duration.ofMillis(0))) - .withMessageContaining("QuietPeriod must be positive"); + .withMessageContaining("'quietPeriod' must be positive"); } @Test void pollIntervalMustBeGreaterThanQuietPeriod() { assertThatIllegalArgumentException() .isThrownBy(() -> new FileSystemWatcher(true, Duration.ofMillis(1), Duration.ofMillis(1))) - .withMessageContaining("PollInterval must be greater than QuietPeriod"); + .withMessageContaining("'pollInterval' must be greater than QuietPeriod"); } @Test void listenerMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> this.watcher.addListener(null)) - .withMessageContaining("FileChangeListener must not be null"); + .withMessageContaining("'fileChangeListener' must not be null"); } @Test @@ -97,7 +97,7 @@ class FileSystemWatcherTests { @Test void sourceDirectoryMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> this.watcher.addSourceDirectory(null)) - .withMessageContaining("Directory must not be null"); + .withMessageContaining("'directory' must not be null"); } @Test @@ -106,7 +106,7 @@ class FileSystemWatcherTests { assertThat(file.createNewFile()).isTrue(); assertThat(file).isFile(); assertThatIllegalArgumentException().isThrownBy(() -> this.watcher.addSourceDirectory(file)) - .withMessageContaining("Directory '" + file + "' must not be a file"); + .withMessageContaining("'directory' [" + file + "] must not be a file"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/FrameTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/FrameTests.java index d54764ffef8..76dd1dc691f 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/FrameTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/livereload/FrameTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,13 +36,13 @@ class FrameTests { @Test void payloadMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new Frame((String) null)) - .withMessageContaining("Payload must not be null"); + .withMessageContaining("'payload' must not be null"); } @Test void typeMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new Frame((Frame.Type) null)) - .withMessageContaining("Type must not be null"); + .withMessageContaining("'type' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploaderTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploaderTests.java index 7b941938d18..bf8cb73e015 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploaderTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,20 +67,20 @@ class ClassPathChangeUploaderTests { @Test void urlMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassPathChangeUploader(null, this.requestFactory)) - .withMessageContaining("URL must not be empty"); + .withMessageContaining("'url' must not be empty"); } @Test void urlMustNotBeEmpty() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassPathChangeUploader("", this.requestFactory)) - .withMessageContaining("URL must not be empty"); + .withMessageContaining("'url' must not be empty"); } @Test void requestFactoryMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new ClassPathChangeUploader("http://localhost:8080", null)) - .withMessageContaining("RequestFactory must not be null"); + .withMessageContaining("'requestFactory' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java index df10274811c..e6a30590ca6 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,28 +77,28 @@ class DelayedLiveReloadTriggerTests { void liveReloadServerMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new DelayedLiveReloadTrigger(null, this.requestFactory, URL)) - .withMessageContaining("LiveReloadServer must not be null"); + .withMessageContaining("'liveReloadServer' must not be null"); } @Test void requestFactoryMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new DelayedLiveReloadTrigger(this.liveReloadServer, null, URL)) - .withMessageContaining("RequestFactory must not be null"); + .withMessageContaining("'requestFactory' must not be null"); } @Test void urlMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new DelayedLiveReloadTrigger(this.liveReloadServer, this.requestFactory, null)) - .withMessageContaining("URL must not be empty"); + .withMessageContaining("'url' must not be empty"); } @Test void urlMustNotBeEmpty() { assertThatIllegalArgumentException() .isThrownBy(() -> new DelayedLiveReloadTrigger(this.liveReloadServer, this.requestFactory, "")) - .withMessageContaining("URL must not be empty"); + .withMessageContaining("'url' must not be empty"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java index 5140994e328..0a474a6272e 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,25 +74,25 @@ class HttpHeaderInterceptorTests { @Test void constructorNullHeaderName() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpHeaderInterceptor(null, this.value)) - .withMessageContaining("Name must not be empty"); + .withMessageContaining("'name' must not be empty"); } @Test void constructorEmptyHeaderName() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpHeaderInterceptor("", this.value)) - .withMessageContaining("Name must not be empty"); + .withMessageContaining("'name' must not be empty"); } @Test void constructorNullHeaderValue() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpHeaderInterceptor(this.name, null)) - .withMessageContaining("Value must not be empty"); + .withMessageContaining("'value' must not be empty"); } @Test void constructorEmptyHeaderValue() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpHeaderInterceptor(this.name, "")) - .withMessageContaining("Value must not be empty"); + .withMessageContaining("'value' must not be empty"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java index b684e14178b..a3bb24216c8 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ class DispatcherFilterTests { @Test void dispatcherMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new DispatcherFilter(null)) - .withMessageContaining("Dispatcher must not be null"); + .withMessageContaining("'dispatcher' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java index 45be879837c..2178e6b00aa 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,13 +63,13 @@ class DispatcherTests { @Test void accessManagerMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new Dispatcher(null, Collections.emptyList())) - .withMessageContaining("AccessManager must not be null"); + .withMessageContaining("'accessManager' must not be null"); } @Test void mappersMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new Dispatcher(this.accessManager, null)) - .withMessageContaining("Mappers must not be null"); + .withMessageContaining("'mappers' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/HttpHeaderAccessManagerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/HttpHeaderAccessManagerTests.java index 1a234cad6ef..b4c0a4f5df9 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/HttpHeaderAccessManagerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/HttpHeaderAccessManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,25 +54,25 @@ class HttpHeaderAccessManagerTests { @Test void headerNameMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpHeaderAccessManager(null, SECRET)) - .withMessageContaining("HeaderName must not be empty"); + .withMessageContaining("'headerName' must not be empty"); } @Test void headerNameMustNotBeEmpty() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpHeaderAccessManager("", SECRET)) - .withMessageContaining("HeaderName must not be empty"); + .withMessageContaining("'headerName' must not be empty"); } @Test void expectedSecretMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpHeaderAccessManager(HEADER, null)) - .withMessageContaining("ExpectedSecret must not be empty"); + .withMessageContaining("'expectedSecret' must not be empty"); } @Test void expectedSecretMustNotBeEmpty() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpHeaderAccessManager(HEADER, "")) - .withMessageContaining("ExpectedSecret must not be empty"); + .withMessageContaining("'expectedSecret' must not be empty"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapperTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapperTests.java index 7febedbb177..cc4f675b5c7 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapperTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/UrlHandlerMapperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,19 +40,19 @@ class UrlHandlerMapperTests { @Test void requestUriMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new UrlHandlerMapper(null, this.handler)) - .withMessageContaining("URL must not be empty"); + .withMessageContaining("'url' must not be empty"); } @Test void requestUriMustNotBeEmpty() { assertThatIllegalArgumentException().isThrownBy(() -> new UrlHandlerMapper("", this.handler)) - .withMessageContaining("URL must not be empty"); + .withMessageContaining("'url' must not be empty"); } @Test void requestUrlMustStartWithSlash() { assertThatIllegalArgumentException().isThrownBy(() -> new UrlHandlerMapper("tunnel", this.handler)) - .withMessageContaining("URL must start with '/'"); + .withMessageContaining("'url' must start with '/'"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MainMethodTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MainMethodTests.java index 758c3f95c7e..5ea21115cbe 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MainMethodTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MainMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ class MainMethodTests { @Test void threadMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new MainMethod(null)) - .withMessageContaining("Thread must not be null"); + .withMessageContaining("'thread' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestarterTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestarterTests.java index ed1dd1bb3a1..f325edd88fe 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestarterTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/RestarterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,7 +113,7 @@ class RestarterTests { @Test void addUrlsMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> Restarter.getInstance().addUrls(null)) - .withMessageContaining("Urls must not be null"); + .withMessageContaining("'urls' must not be null"); } @Test @@ -130,7 +130,7 @@ class RestarterTests { @Test void addClassLoaderFilesMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> Restarter.getInstance().addClassLoaderFiles(null)) - .withMessageContaining("ClassLoaderFiles must not be null"); + .withMessageContaining("'classLoaderFiles' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFileTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFileTests.java index db89e0b2d77..286781ae487 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFileTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFileTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,25 +35,25 @@ class ClassLoaderFileTests { @Test void kindMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(null, null)) - .withMessageContaining("Kind must not be null"); + .withMessageContaining("'kind' must not be null"); } @Test void addedContentsMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(Kind.ADDED, null)) - .withMessageContaining("Contents must not be null"); + .withMessageContaining("'contents' must not be null"); } @Test void modifiedContentsMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(Kind.MODIFIED, null)) - .withMessageContaining("Contents must not be null"); + .withMessageContaining("'contents' must not be null"); } @Test void deletedContentsMustBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(Kind.DELETED, new byte[10])) - .withMessageContaining("Contents must be null"); + .withMessageContaining("'contents' must be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFilesTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFilesTests.java index a965dcefeac..c3903bcec95 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFilesTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFilesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,13 +43,13 @@ class ClassLoaderFilesTests { @Test void addFileNameMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> this.files.addFile(null, mock(ClassLoaderFile.class))) - .withMessageContaining("Name must not be null"); + .withMessageContaining("'name' must not be null"); } @Test void addFileFileMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> this.files.addFile("test", null)) - .withMessageContaining("File must not be null"); + .withMessageContaining("'file' must not be null"); } @Test @@ -153,7 +153,7 @@ class ClassLoaderFilesTests { @Test void classLoaderFilesMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFiles(null)) - .withMessageContaining("ClassLoaderFiles must not be null"); + .withMessageContaining("'classLoaderFiles' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java index 40f9fcc3ac1..612686599a0 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/RestartClassLoaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,14 +104,14 @@ class RestartClassLoaderTests { @Test void parentMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new RestartClassLoader(null, new URL[] {})) - .withMessageContaining("Parent must not be null"); + .withMessageContaining("'parent' must not be null"); } @Test void updatedFilesMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new RestartClassLoader(this.parentClassLoader, new URL[] {}, null)) - .withMessageContaining("UpdatedFiles must not be null"); + .withMessageContaining("'updatedFiles' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerHandlerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerHandlerTests.java index 8d0ec158fcf..905d5186831 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerHandlerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ class HttpRestartServerHandlerTests { @Test void serverMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpRestartServerHandler(null)) - .withMessageContaining("Server must not be null"); + .withMessageContaining("'server' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerTests.java index 1d8842812e1..2c100127d42 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,13 +60,13 @@ class HttpRestartServerTests { @Test void sourceDirectoryUrlFilterMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpRestartServer((SourceDirectoryUrlFilter) null)) - .withMessageContaining("SourceDirectoryUrlFilter must not be null"); + .withMessageContaining("'sourceDirectoryUrlFilter' must not be null"); } @Test void restartServerMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new HttpRestartServer((RestartServer) null)) - .withMessageContaining("RestartServer must not be null"); + .withMessageContaining("'restartServer' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/RestartServerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/RestartServerTests.java index 1305a65d480..728d32a3b90 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/RestartServerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/RestartServerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ class RestartServerTests { @Test void sourceDirectoryUrlFilterMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new RestartServer((SourceDirectoryUrlFilter) null)) - .withMessageContaining("SourceDirectoryUrlFilter must not be null"); + .withMessageContaining("'sourceDirectoryUrlFilter' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DockerComposeFile.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DockerComposeFile.java index 37382a7fbb4..41c099cfb11 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DockerComposeFile.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DockerComposeFile.java @@ -129,9 +129,9 @@ public final class DockerComposeFile { * @return the Docker Compose file */ public static DockerComposeFile of(File file) { - Assert.notNull(file, "File must not be null"); - Assert.isTrue(file.exists(), () -> "Docker Compose file '%s' does not exist".formatted(file)); - Assert.isTrue(file.isFile(), () -> "Docker compose file '%s' is not a file".formatted(file)); + Assert.notNull(file, "'file' must not be null"); + Assert.isTrue(file.exists(), () -> "'file' [%s] must exist".formatted(file)); + Assert.isTrue(file.isFile(), () -> "'file' [%s] must be a normal file".formatted(file)); return new DockerComposeFile(Collections.singletonList(file)); } @@ -142,11 +142,11 @@ public final class DockerComposeFile { * @since 3.4.0 */ public static DockerComposeFile of(Collection files) { - Assert.notNull(files, "Files must not be null"); + Assert.notNull(files, "'files' must not be null"); for (File file : files) { - Assert.notNull(file, "File must not be null"); - Assert.isTrue(file.exists(), () -> "Docker Compose file '%s' does not exist".formatted(file)); - Assert.isTrue(file.isFile(), () -> "Docker compose file '%s' is not a file".formatted(file)); + Assert.notNull(file, "'files' must not contain null elements"); + Assert.isTrue(file.exists(), () -> "'files' content [%s] must exist".formatted(file)); + Assert.isTrue(file.isFile(), () -> "'files' content [%s] must be a normal file".formatted(file)); } return new DockerComposeFile(List.copyOf(files)); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ImageName.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ImageName.java index 931ce4d2272..5f0aee3b31d 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ImageName.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ImageName.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ class ImageName { private final String string; ImageName(String domain, String path) { - Assert.hasText(path, "Path must not be empty"); + Assert.hasText(path, "'path' must not be empty"); this.domain = getDomainOrDefault(domain); this.name = getNameWithDefaultPath(this.domain, path); this.string = this.domain + "/" + this.name; @@ -114,13 +114,12 @@ class ImageName { } static ImageName of(String value) { - Assert.hasText(value, "Value must not be empty"); + Assert.hasText(value, "'value' must not be empty"); String domain = parseDomain(value); String path = (domain != null) ? value.substring(domain.length() + 1) : value; Assert.isTrue(Regex.PATH.matcher(path).matches(), - () -> "Unable to parse name \"" + value + "\". " - + "Image name must be in the form '[domainHost:port/][path/]name', " - + "with 'path' and 'name' containing only [a-z0-9][.][_][-]"); + () -> "'value' path must contain an image reference in the form '[domainHost:port/][path/]name' " + + "(with 'path' and 'name' containing only [a-z0-9][.][_][-]) [" + value + "]"); return new ImageName(domain, path); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ImageReference.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ImageReference.java index 33c0ba87310..32d1eba4458 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ImageReference.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ImageReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ public final class ImageReference { private final String string; private ImageReference(ImageName name, String tag, String digest) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); this.name = name; this.tag = tag; this.digest = digest; @@ -136,7 +136,7 @@ public final class ImageReference { * @return an {@link ImageReference} instance */ public static ImageReference of(String value) { - Assert.hasText(value, "Value must not be null"); + Assert.hasText(value, "'value' must not be null"); String domain = ImageName.parseDomain(value); String path = (domain != null) ? value.substring(domain.length() + 1) : value; String digest = null; @@ -162,9 +162,9 @@ public final class ImageReference { } } Assert.isTrue(Regex.PATH.matcher(path).matches(), - () -> "Unable to parse image reference \"" + value + "\". " - + "Image reference must be in the form '[domainHost:port/][path/]name[:tag][@digest]', " - + "with 'path' and 'name' containing only [a-z0-9][.][_][-]"); + () -> "'value' path must contain an image reference in the form " + + "'[domainHost:port/][path/]name[:tag][@digest] " + + "(with 'path' and 'name' containing only [a-z0-9][.][_][-]) [" + value + "]"); ImageName name = new ImageName(domain, path); return new ImageReference(name, tag, digest); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/ConnectionNamePredicate.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/ConnectionNamePredicate.java index 1990f9b2713..3a32f79a388 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/ConnectionNamePredicate.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/ConnectionNamePredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ class ConnectionNamePredicate implements Predicate required; ConnectionNamePredicate(String... required) { - Assert.notEmpty(required, "Required must not be empty"); + Assert.notEmpty(required, "'required' must not be empty"); this.required = Arrays.stream(required).map(this::asCanonicalName).collect(Collectors.toSet()); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/DockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/DockerComposeConnectionDetailsFactory.java index 302a3ba3581..0224c443cc7 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/DockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/DockerComposeConnectionDetailsFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,7 +111,7 @@ public abstract class DockerComposeConnectionDetailsFactory result = new LinkedHashMap<>(); for (String parameter : StringUtils.commaDelimitedListToStringArray(parameters)) { String[] parts = parameter.split("="); - Assert.state(parts.length == 2, () -> "Unable to parse parameter '%s'".formatted(parameter)); + Assert.state(parts.length == 2, () -> "'parameters' [%s] must cotain parsable value".formatted(parameter)); result.put(parts[0], parts[1]); } return Collections.unmodifiableMap(result); diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeFileTests.java b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeFileTests.java index dfd99833796..114dce29cd6 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeFileTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeFileTests.java @@ -129,20 +129,20 @@ class DockerComposeFileTests { @Test void ofWhenFileIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> DockerComposeFile.of((File) null)) - .withMessage("File must not be null"); + .withMessage("'file' must not be null"); } @Test void ofWhenFileDoesNotExistThrowsException() { File file = new File(this.temp, "missing"); assertThatIllegalArgumentException().isThrownBy(() -> DockerComposeFile.of(file)) - .withMessageEndingWith("does not exist"); + .withMessageEndingWith("must exist"); } @Test void ofWhenFileIsNotFileThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> DockerComposeFile.of(this.temp)) - .withMessageEndingWith("is not a file"); + .withMessageEndingWith("must be a normal file"); } private DockerComposeFile createComposeFile(String name) throws IOException { diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/ImageNameTests.java b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/ImageNameTests.java index 76f7fb3228e..ea40164be05 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/ImageNameTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/ImageNameTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,25 +118,26 @@ class ImageNameTests { @Test void ofWhenNameIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of(null)) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test void ofWhenNameIsEmptyThrowsException() { - assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of("")).withMessage("Value must not be empty"); + assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of("")) + .withMessage("'value' must not be empty"); } @Test void ofWhenContainsUppercaseThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of("Test")) - .withMessageContaining("Unable to parse name") + .withMessageContaining("must contain an image reference") .withMessageContaining("Test"); } @Test void ofWhenNameIncludesTagThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of("ubuntu:latest")) - .withMessageContaining("Unable to parse name") + .withMessageContaining("must contain an image reference") .withMessageContaining(":latest"); } @@ -144,7 +145,7 @@ class ImageNameTests { void ofWhenNameIncludeDigestThrowsException() { assertThatIllegalArgumentException().isThrownBy( () -> ImageName.of("ubuntu@sha256:47bfdb88c3ae13e488167607973b7688f69d9e8c142c2045af343ec199649c09")) - .withMessageContaining("Unable to parse name") + .withMessageContaining("must contain an image reference") .withMessageContaining("@sha256:47b"); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/ImageReferenceTests.java b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/ImageReferenceTests.java index e9eb9045819..caff7a7092b 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/ImageReferenceTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/ImageReferenceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -165,7 +165,7 @@ class ImageReferenceTests { assertThatIllegalArgumentException() .isThrownBy(() -> ImageReference .of("registry.example.com/example/example-app:1.6.0-dev.2.uncommitted+wip.foo.c75795d")) - .withMessageContaining("Unable to parse image reference"); + .withMessageContaining("must contain an image reference"); } @Test @@ -173,7 +173,7 @@ class ImageReferenceTests { void ofWhenImageNameIsVeryLongAndHasIllegalCharacterThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ImageReference .of("docker.io/library/this-image-has-a-long-name-with-an-invalid-tag-which-is-at-danger-of-catastrophic-backtracking:1.0.0+1234")) - .withMessageContaining("Unable to parse image reference"); + .withMessageContaining("must contain an image reference"); } @Test diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/jdbc/JdbcUrlBuilderTests.java b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/jdbc/JdbcUrlBuilderTests.java index bb0589a16ae..f2cc0cc09c8 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/jdbc/JdbcUrlBuilderTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/jdbc/JdbcUrlBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ class JdbcUrlBuilderTests { @Test void createWhenDriverProtocolIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new JdbcUrlBuilder(null, 123)) - .withMessage("DriverProtocol must not be null"); + .withMessage("'driverProtocol' must not be null"); } @Test @@ -84,7 +84,7 @@ class JdbcUrlBuilderTests { @Test void buildWhenServiceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.builder.build(null, "mydb")) - .withMessage("Service must not be null"); + .withMessage("'service' must not be null"); } private RunningService mockService(int mappedPort) { diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/r2dbc/ConnectionFactoryOptionsBuilderTests.java b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/r2dbc/ConnectionFactoryOptionsBuilderTests.java index 91fd383c368..0e75c4f90f3 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/r2dbc/ConnectionFactoryOptionsBuilderTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/r2dbc/ConnectionFactoryOptionsBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ class ConnectionFactoryOptionsBuilderTests { @Test void createWhenDriverProtocolIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new JdbcUrlBuilder(null, 123)) - .withMessage("DriverProtocol must not be null"); + .withMessage("'driverProtocol' must not be null"); } @Test @@ -81,14 +81,14 @@ class ConnectionFactoryOptionsBuilderTests { @Test void buildWhenServiceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.builder.build(null, "mydb", "user", "pass")) - .withMessage("Service must not be null"); + .withMessage("'service' must not be null"); } @Test void buildWhenDatabaseIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.builder.build(mockService(456), null, "user", "pass")) - .withMessage("Database must not be null"); + .withMessage("'database' must not be null"); } private RunningService mockService(int mappedPort) { diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.java index f2ef2cfbb54..ea5fde11f22 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/application/customizetheenvironmentorapplicationcontext/MyEnvironmentPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor { } private PropertySource loadYaml(Resource path) { - Assert.isTrue(path.exists(), () -> "Resource " + path + " does not exist"); + Assert.isTrue(path.exists(), () -> "'path' [%s] must exist".formatted(path)); try { return this.loader.load("custom-resource", path).get(0); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/FilterAnnotations.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/FilterAnnotations.java index 8626043851c..d9a1bd2d4dc 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/FilterAnnotations.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/FilterAnnotations.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ public class FilterAnnotations implements Iterable { private final List filters; public FilterAnnotations(ClassLoader classLoader, Filter[] filters) { - Assert.notNull(filters, "Filters must not be null"); + Assert.notNull(filters, "'filters' must not be null"); this.classLoader = classLoader; this.filters = createTypeFilters(filters); } @@ -72,16 +72,16 @@ public class FilterAnnotations implements Iterable { return switch (filterType) { case ANNOTATION -> { Assert.isAssignable(Annotation.class, filterClass, - "An error occurred while processing an ANNOTATION type filter: "); + "'filterClass' must be an Annotation when 'filterType' is ANNOTATION"); yield new AnnotationTypeFilter((Class) filterClass); } case ASSIGNABLE_TYPE -> new AssignableTypeFilter(filterClass); case CUSTOM -> { Assert.isAssignable(TypeFilter.class, filterClass, - "An error occurred while processing a CUSTOM type filter: "); + "'filterClass' must be a TypeFilter when 'filterType' is CUSTOM"); yield BeanUtils.instantiateClass(filterClass, TypeFilter.class); } - default -> throw new IllegalArgumentException("Filter type not supported with Class value: " + filterType); + default -> throw new IllegalArgumentException("'filterClass' not supported [" + filterType + "]"); }; } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java index 36b2698ec04..10b099f61ed 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/TestDatabaseAutoConfiguration.java @@ -126,8 +126,8 @@ public class TestDatabaseAutoConfiguration { if (AotDetector.useGeneratedArtifacts()) { return; } - Assert.isInstanceOf(ConfigurableListableBeanFactory.class, registry, - "Test Database Auto-configuration can only be used with a ConfigurableListableBeanFactory"); + Assert.isTrue(registry instanceof ConfigurableListableBeanFactory, + "'registry' must be a ConfigurableListableBeanFactory"); process(registry, (ConfigurableListableBeanFactory) registry); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManager.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManager.java index bd9c22d2203..3e24d6579da 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManager.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ public class TestEntityManager { * @param entityManagerFactory the source entity manager factory */ public TestEntityManager(EntityManagerFactory entityManagerFactory) { - Assert.notNull(entityManagerFactory, "EntityManagerFactory must not be null"); + Assert.notNull(entityManagerFactory, "'entityManagerFactory' must not be null"); this.entityManagerFactory = entityManagerFactory; } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java index 693a5431d03..6df4c133892 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/SpringBootMockMvcBuilderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ public class SpringBootMockMvcBuilderCustomizer implements MockMvcBuilderCustomi * @param context the source application context */ public SpringBootMockMvcBuilderCustomizer(WebApplicationContext context) { - Assert.notNull(context, "Context must not be null"); + Assert.notNull(context, "'context' must not be null"); this.context = context; } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerTests.java index 8ec9c28b7d2..fb8e9a749ff 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestEntityManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,7 @@ class TestEntityManagerTests { @Test void createWhenEntityManagerIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new TestEntityManager(null)) - .withMessageContaining("EntityManagerFactory must not be null"); + .withMessageContaining("'entityManagerFactory' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/AnnotatedClassFinder.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/AnnotatedClassFinder.java index 9fdf7803b20..e0cc152ac4b 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/AnnotatedClassFinder.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/AnnotatedClassFinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ public final class AnnotatedClassFinder { * @param annotationType the annotation to find */ public AnnotatedClassFinder(Class annotationType) { - Assert.notNull(annotationType, "AnnotationType must not be null"); + Assert.notNull(annotationType, "'annotationType' must not be null"); this.annotationType = annotationType; this.scanner = new ClassPathScanningCandidateComponentProvider(false); this.scanner.addIncludeFilter(new AnnotationTypeFilter(annotationType)); @@ -64,7 +64,7 @@ public final class AnnotatedClassFinder { * hierarchy defined by the given {@code source} or {@code null} if none is found. */ public Class findFromClass(Class source) { - Assert.notNull(source, "Source must not be null"); + Assert.notNull(source, "'source' must not be null"); return findFromPackage(ClassUtils.getPackageName(source)); } @@ -76,7 +76,7 @@ public final class AnnotatedClassFinder { * hierarchy defined by the given {@code source} or {@code null} if none is found. */ public Class findFromPackage(String source) { - Assert.notNull(source, "Source must not be null"); + Assert.notNull(source, "'source' must not be null"); Class configuration = cache.get(source); if (configuration == null) { configuration = scanPackage(source); diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java index 02fa5109d8b..44d0dc491f7 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ public class ApplicationContextAssert */ ApplicationContextAssert(C applicationContext, Throwable startupFailure) { super(applicationContext, ApplicationContextAssert.class); - Assert.notNull(applicationContext, "ApplicationContext must not be null"); + Assert.notNull(applicationContext, "'applicationContext' must not be null"); this.startupFailure = startupFailure; } @@ -121,7 +121,7 @@ public class ApplicationContextAssert * given type */ public ApplicationContextAssert hasSingleBean(Class type, Scope scope) { - Assert.notNull(scope, "Scope must not be null"); + Assert.notNull(scope, "'scope' must not be null"); if (this.startupFailure != null) { throwAssertionError(contextFailedToStartWhenExpecting("to have a single bean of type:%n <%s>", type)); } @@ -168,7 +168,7 @@ public class ApplicationContextAssert * type */ public ApplicationContextAssert doesNotHaveBean(Class type, Scope scope) { - Assert.notNull(scope, "Scope must not be null"); + Assert.notNull(scope, "'scope' must not be null"); if (this.startupFailure != null) { throwAssertionError(contextFailedToStartWhenExpecting("not to have any beans of type:%n <%s>", type)); } @@ -265,7 +265,7 @@ public class ApplicationContextAssert * given type */ public AbstractObjectAssert getBean(Class type, Scope scope) { - Assert.notNull(scope, "Scope must not be null"); + Assert.notNull(scope, "'scope' must not be null"); if (this.startupFailure != null) { throwAssertionError(contextFailedToStartWhenExpecting("to contain bean of type:%n <%s>", type)); } @@ -407,7 +407,7 @@ public class ApplicationContextAssert * @throws AssertionError if the application context did not start */ public MapAssert getBeans(Class type, Scope scope) { - Assert.notNull(scope, "Scope must not be null"); + Assert.notNull(scope, "'scope' must not be null"); if (this.startupFailure != null) { throwAssertionError(contextFailedToStartWhenExpecting("to get beans of type:%n <%s>", type)); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProvider.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProvider.java index 8542c5aa675..f6219e83efb 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProvider.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -127,10 +127,10 @@ public interface ApplicationContextAssertProvider static , C extends ApplicationContext> T get(Class type, Class contextType, Supplier contextSupplier, Class... additionalContextInterfaces) { - Assert.notNull(type, "Type must not be null"); - Assert.isTrue(type.isInterface(), "Type must be an interface"); - Assert.notNull(contextType, "ContextType must not be null"); - Assert.isTrue(contextType.isInterface(), "ContextType must be an interface"); + Assert.notNull(type, "'type' must not be null"); + Assert.isTrue(type.isInterface(), "'type' must be an interface"); + Assert.notNull(contextType, "'contextType' must not be null"); + Assert.isTrue(contextType.isInterface(), "'contextType' must be an interface"); Class[] interfaces = merge(new Class[] { type, contextType }, additionalContextInterfaces); return (T) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaces, new AssertProviderApplicationContextInvocationHandler(contextType, contextSupplier)); diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java index 5bb815e9a48..0c5cbac32a1 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,8 +154,8 @@ public abstract class AbstractApplicationContextRunner configuration, Function, SELF> instanceFactory) { - Assert.notNull(configuration, "RunnerConfiguration must not be null"); - Assert.notNull(instanceFactory, "instanceFactory must not be null"); + Assert.notNull(configuration, "'configuration' must not be null"); + Assert.notNull(instanceFactory, "'instanceFactory' must not be null"); this.runnerConfiguration = configuration; this.instanceFactory = instanceFactory; } @@ -190,7 +190,7 @@ public abstract class AbstractApplicationContextRunner initializer) { - Assert.notNull(initializer, "Initializer must not be null"); + Assert.notNull(initializer, "'initializer' must not be null"); return newInstance(this.runnerConfiguration.withInitializer(initializer)); } @@ -332,7 +332,7 @@ public abstract class AbstractApplicationContextRunner withInitializer(ApplicationContextInitializer initializer) { - Assert.notNull(initializer, "Initializer must not be null"); + Assert.notNull(initializer, "'initializer' must not be null"); RunnerConfiguration config = new RunnerConfiguration<>(this); config.initializers = add(config.initializers, initializer); return config; @@ -605,7 +605,7 @@ public abstract class AbstractApplicationContextRunner withConfiguration(Configurations configurations) { - Assert.notNull(configurations, "Configurations must not be null"); + Assert.notNull(configurations, "'configurations' must not be null"); RunnerConfiguration config = new RunnerConfiguration<>(this); config.configurations = add(config.configurations, configurations); return config; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/ContextConsumer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/ContextConsumer.java index 8c80978726c..c11829effa1 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/ContextConsumer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/ContextConsumer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public interface ContextConsumer { * @since 2.6.0 */ default ContextConsumer andThen(ContextConsumer after) { - Assert.notNull(after, "After must not be null"); + Assert.notNull(after, "'after' must not be null"); return (context) -> { accept(context); after.accept(context); diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/AbstractJsonMarshalTester.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/AbstractJsonMarshalTester.java index ae9066273f0..4eb2f11204e 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/AbstractJsonMarshalTester.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/AbstractJsonMarshalTester.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,8 +85,8 @@ public abstract class AbstractJsonMarshalTester { * @param type the type under test */ public AbstractJsonMarshalTester(Class resourceLoadClass, ResolvableType type) { - Assert.notNull(resourceLoadClass, "ResourceLoadClass must not be null"); - Assert.notNull(type, "Type must not be null"); + Assert.notNull(resourceLoadClass, "'resourceLoadClass' must not be null"); + Assert.notNull(type, "'type' must not be null"); initialize(resourceLoadClass, type); } @@ -127,7 +127,7 @@ public abstract class AbstractJsonMarshalTester { */ public JsonContent write(T value) throws IOException { verify(); - Assert.notNull(value, "Value must not be null"); + Assert.notNull(value, "'value' must not be null"); String json = writeObject(value, this.type); return getJsonContent(json); } @@ -162,7 +162,7 @@ public abstract class AbstractJsonMarshalTester { */ public ObjectContent parse(byte[] jsonBytes) throws IOException { verify(); - Assert.notNull(jsonBytes, "JsonBytes must not be null"); + Assert.notNull(jsonBytes, "'jsonBytes' must not be null"); return read(new ByteArrayResource(jsonBytes)); } @@ -185,7 +185,7 @@ public abstract class AbstractJsonMarshalTester { */ public ObjectContent parse(String jsonString) throws IOException { verify(); - Assert.notNull(jsonString, "JsonString must not be null"); + Assert.notNull(jsonString, "'jsonString' must not be null"); return read(new StringReader(jsonString)); } @@ -210,7 +210,7 @@ public abstract class AbstractJsonMarshalTester { */ public ObjectContent read(String resourcePath) throws IOException { verify(); - Assert.notNull(resourcePath, "ResourcePath must not be null"); + Assert.notNull(resourcePath, "'resourcePath' must not be null"); return read(new ClassPathResource(resourcePath, this.resourceLoadClass)); } @@ -233,7 +233,7 @@ public abstract class AbstractJsonMarshalTester { */ public ObjectContent read(File file) throws IOException { verify(); - Assert.notNull(file, "File must not be null"); + Assert.notNull(file, "'file' must not be null"); return read(new FileSystemResource(file)); } @@ -256,7 +256,7 @@ public abstract class AbstractJsonMarshalTester { */ public ObjectContent read(InputStream inputStream) throws IOException { verify(); - Assert.notNull(inputStream, "InputStream must not be null"); + Assert.notNull(inputStream, "'inputStream' must not be null"); return read(new InputStreamResource(inputStream)); } @@ -279,7 +279,7 @@ public abstract class AbstractJsonMarshalTester { */ public ObjectContent read(Resource resource) throws IOException { verify(); - Assert.notNull(resource, "Resource must not be null"); + Assert.notNull(resource, "'resource' must not be null"); InputStream inputStream = resource.getInputStream(); T object = readObject(inputStream, this.type); closeQuietly(inputStream); @@ -305,7 +305,7 @@ public abstract class AbstractJsonMarshalTester { */ public ObjectContent read(Reader reader) throws IOException { verify(); - Assert.notNull(reader, "Reader must not be null"); + Assert.notNull(reader, "'reader' must not be null"); T object = readObject(reader, this.type); closeQuietly(reader); return new ObjectContent<>(this.type, object); @@ -368,19 +368,19 @@ public abstract class AbstractJsonMarshalTester { @SuppressWarnings("rawtypes") protected FieldInitializer(Class testerClass) { - Assert.notNull(testerClass, "TesterClass must not be null"); + Assert.notNull(testerClass, "'testerClass' must not be null"); this.testerClass = testerClass; } public void initFields(Object testInstance, M marshaller) { - Assert.notNull(testInstance, "TestInstance must not be null"); - Assert.notNull(marshaller, "Marshaller must not be null"); + Assert.notNull(testInstance, "'testInstance' must not be null"); + Assert.notNull(marshaller, "'marshaller' must not be null"); initFields(testInstance, () -> marshaller); } public void initFields(Object testInstance, final ObjectFactory marshaller) { - Assert.notNull(testInstance, "TestInstance must not be null"); - Assert.notNull(marshaller, "Marshaller must not be null"); + Assert.notNull(testInstance, "'testInstance' must not be null"); + Assert.notNull(marshaller, "'marshaller' must not be null"); ReflectionUtils.doWithFields(testInstance.getClass(), (field) -> doWithField(field, testInstance, marshaller)); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java index 9b9bf84b3af..71f6dea0b3f 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/BasicJsonTester.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ public class BasicJsonTester { * @since 1.4.1 */ public BasicJsonTester(Class resourceLoadClass, Charset charset) { - Assert.notNull(resourceLoadClass, "ResourceLoadClass must not be null"); + Assert.notNull(resourceLoadClass, "'resourceLoadClass' must not be null"); this.loader = new JsonLoader(resourceLoadClass, charset); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/GsonTester.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/GsonTester.java index 797c98918c8..d8f7522eb82 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/GsonTester.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/GsonTester.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ public class GsonTester extends AbstractJsonMarshalTester { * @param gson the Gson instance */ protected GsonTester(Gson gson) { - Assert.notNull(gson, "Gson must not be null"); + Assert.notNull(gson, "'gson' must not be null"); this.gson = gson; } @@ -75,7 +75,7 @@ public class GsonTester extends AbstractJsonMarshalTester { */ public GsonTester(Class resourceLoadClass, ResolvableType type, Gson gson) { super(resourceLoadClass, type); - Assert.notNull(gson, "Gson must not be null"); + Assert.notNull(gson, "'gson' must not be null"); this.gson = gson; } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java index 97d58ff8ec4..3fb169b4ca8 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JacksonTester.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,7 +73,7 @@ public class JacksonTester extends AbstractJsonMarshalTester { * @param objectMapper the Jackson object mapper */ protected JacksonTester(ObjectMapper objectMapper) { - Assert.notNull(objectMapper, "ObjectMapper must not be null"); + Assert.notNull(objectMapper, "'objectMapper' must not be null"); this.objectMapper = objectMapper; } @@ -89,7 +89,7 @@ public class JacksonTester extends AbstractJsonMarshalTester { public JacksonTester(Class resourceLoadClass, ResolvableType type, ObjectMapper objectMapper, Class view) { super(resourceLoadClass, type); - Assert.notNull(objectMapper, "ObjectMapper must not be null"); + Assert.notNull(objectMapper, "'objectMapper' must not be null"); this.objectMapper = objectMapper; this.view = view; } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java index 94169a62e85..98ff2675af6 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,9 +60,9 @@ public final class JsonContent implements AssertProvider { * @param configuration the JsonPath configuration */ JsonContent(Class resourceLoadClass, ResolvableType type, String json, Configuration configuration) { - Assert.notNull(resourceLoadClass, "ResourceLoadClass must not be null"); - Assert.notNull(json, "JSON must not be null"); - Assert.notNull(configuration, "Configuration must not be null"); + Assert.notNull(resourceLoadClass, "'resourceLoadClass' must not be null"); + Assert.notNull(json, "'json' must not be null"); + Assert.notNull(configuration, "'configuration' must not be null"); this.resourceLoadClass = resourceLoadClass; this.type = type; this.json = json; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java index 797abc24de5..17d6c5ccfb2 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContentAssert.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1060,7 +1060,7 @@ public class JsonContentAssert extends AbstractAssert extends AbstractJsonMarshalTester { * @param jsonb the Jsonb instance */ protected JsonbTester(Jsonb jsonb) { - Assert.notNull(jsonb, "Jsonb must not be null"); + Assert.notNull(jsonb, "'jsonb' must not be null"); this.jsonb = jsonb; } @@ -75,7 +75,7 @@ public class JsonbTester extends AbstractJsonMarshalTester { */ public JsonbTester(Class resourceLoadClass, ResolvableType type, Jsonb jsonb) { super(resourceLoadClass, type); - Assert.notNull(jsonb, "Jsonb must not be null"); + Assert.notNull(jsonb, "'jsonb' must not be null"); this.jsonb = jsonb; } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java index 8535b82b019..85e9e075390 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ public final class ObjectContent implements AssertProvider[] extraInterfaces, Answers answer, boolean serializable, MockReset reset, QualifierDefinition qualifier) { super(name, reset, false, qualifier); - Assert.notNull(typeToMock, "TypeToMock must not be null"); + Assert.notNull(typeToMock, "'typeToMock' must not be null"); this.typeToMock = typeToMock; this.extraInterfaces = asClassSet(extraInterfaces); this.answer = (answer != null) ? answer : Answers.RETURNS_DEFAULTS; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java index d4e77598801..9249dc6616c 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,7 +92,7 @@ public enum MockReset { * @return the configured settings */ public static MockSettings apply(MockReset reset, MockSettings settings) { - Assert.notNull(settings, "Settings must not be null"); + Assert.notNull(settings, "'settings' must not be null"); if (reset != null && reset != NONE) { settings.invocationListeners(new ResetInvocationListener(reset)); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java index cb5774d092d..12a96f6a4d3 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -123,15 +123,14 @@ public class MockitoPostProcessor implements InstantiationAwareBeanPostProcessor @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { - Assert.isInstanceOf(ConfigurableListableBeanFactory.class, beanFactory, - "Mock beans can only be used with a ConfigurableListableBeanFactory"); + Assert.isTrue(beanFactory instanceof ConfigurableListableBeanFactory, + "'beanFactory' must be a ConfigurableListableBeanFactory"); this.beanFactory = beanFactory; } @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { - Assert.isInstanceOf(BeanDefinitionRegistry.class, beanFactory, - "@MockBean can only be used on bean factories that implement BeanDefinitionRegistry"); + Assert.isTrue(beanFactory instanceof BeanDefinitionRegistry, "'beanFactory' must be a BeanDefinitionRegistry"); postProcessBeanFactory(beanFactory, (BeanDefinitionRegistry) beanFactory); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyDefinition.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyDefinition.java index 5a9bb64f5b3..92e963cb393 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyDefinition.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/SpyDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ class SpyDefinition extends Definition { SpyDefinition(String name, ResolvableType typeToSpy, MockReset reset, boolean proxyTargetAware, QualifierDefinition qualifier) { super(name, reset, proxyTargetAware, qualifier); - Assert.notNull(typeToSpy, "TypeToSpy must not be null"); + Assert.notNull(typeToSpy, "'typeToSpy' must not be null"); this.typeToSpy = typeToSpy; } @@ -94,7 +94,7 @@ class SpyDefinition extends Definition { @SuppressWarnings("unchecked") T createSpy(String name, Object instance) { - Assert.notNull(instance, "Instance must not be null"); + Assert.notNull(instance, "'instance' must not be null"); Assert.isInstanceOf(this.typeToSpy.resolve(), instance); if (Mockito.mockingDetails(instance).isSpy()) { return (T) instance; diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/util/TestPropertyValues.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/util/TestPropertyValues.java index 3a516ebe40b..6d1e50e14e3 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/util/TestPropertyValues.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/util/TestPropertyValues.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -155,9 +155,9 @@ public final class TestPropertyValues { * @param name the name for the property source */ public void applyTo(ConfigurableEnvironment environment, Type type, String name) { - Assert.notNull(environment, "Environment must not be null"); - Assert.notNull(type, "Property source type must not be null"); - Assert.notNull(name, "Property source name must not be null"); + Assert.notNull(environment, "'environment' must not be null"); + Assert.notNull(type, "'type' must not be null"); + Assert.notNull(name, "'name' must not be null"); MutablePropertySources sources = environment.getPropertySources(); addToSources(sources, type, name); ConfigurationPropertySources.attach(environment); @@ -324,7 +324,7 @@ public final class TestPropertyValues { private final String value; private Pair(String name, String value) { - Assert.hasLength(name, "Name must not be empty"); + Assert.hasLength(name, "'name' must not be empty"); this.name = name; this.value = value; } @@ -401,7 +401,7 @@ public final class TestPropertyValues { } private String setOrClear(String name, String value) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); if (!StringUtils.hasLength(value)) { return (String) System.getProperties().remove(name); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandler.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandler.java index 035779d2ec8..41ab878c721 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandler.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,8 +72,8 @@ public class LocalHostUriTemplateHandler extends RootUriTemplateHandler { */ public LocalHostUriTemplateHandler(Environment environment, String scheme, UriTemplateHandler handler) { super(handler); - Assert.notNull(environment, "Environment must not be null"); - Assert.notNull(scheme, "Scheme must not be null"); + Assert.notNull(environment, "'environment' must not be null"); + Assert.notNull(scheme, "'scheme' must not be null"); this.environment = environment; this.scheme = scheme; } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java index 7c98aa76dc9..fef4c1af069 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,7 @@ public class MockServerRestClientCustomizer implements RestClientCustomizer { */ public MockServerRestClientCustomizer(Class expectationManager) { this(() -> BeanUtils.instantiateClass(expectationManager)); - Assert.notNull(expectationManager, "ExpectationManager must not be null"); + Assert.notNull(expectationManager, "'expectationManager' must not be null"); } /** @@ -90,7 +90,7 @@ public class MockServerRestClientCustomizer implements RestClientCustomizer { * @since 3.0.0 */ public MockServerRestClientCustomizer(Supplier expectationManagerSupplier) { - Assert.notNull(expectationManagerSupplier, "ExpectationManagerSupplier must not be null"); + Assert.notNull(expectationManagerSupplier, "'expectationManagerSupplier' must not be null"); this.expectationManagerSupplier = expectationManagerSupplier; } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java index 3cd206bc1a7..985fce7ce1b 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,7 +82,7 @@ public class MockServerRestTemplateCustomizer implements RestTemplateCustomizer */ public MockServerRestTemplateCustomizer(Class expectationManager) { this(() -> BeanUtils.instantiateClass(expectationManager)); - Assert.notNull(expectationManager, "ExpectationManager must not be null"); + Assert.notNull(expectationManager, "'expectationManager' must not be null"); } /** @@ -92,7 +92,7 @@ public class MockServerRestTemplateCustomizer implements RestTemplateCustomizer * @since 3.0.0 */ public MockServerRestTemplateCustomizer(Supplier expectationManagerSupplier) { - Assert.notNull(expectationManagerSupplier, "ExpectationManagerSupplier must not be null"); + Assert.notNull(expectationManagerSupplier, "'expectationManagerSupplier' must not be null"); this.expectationManagerSupplier = expectationManagerSupplier; } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/RootUriRequestExpectationManager.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/RootUriRequestExpectationManager.java index 6905c74e835..5912cb6f223 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/RootUriRequestExpectationManager.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/RootUriRequestExpectationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,8 +61,8 @@ public class RootUriRequestExpectationManager implements RequestExpectationManag private final RequestExpectationManager expectationManager; public RootUriRequestExpectationManager(String rootUri, RequestExpectationManager expectationManager) { - Assert.notNull(rootUri, "RootUri must not be null"); - Assert.notNull(expectationManager, "ExpectationManager must not be null"); + Assert.notNull(rootUri, "'rootUri' must not be null"); + Assert.notNull(expectationManager, "'expectationManager' must not be null"); this.rootUri = rootUri; this.expectationManager = expectationManager; } @@ -156,7 +156,7 @@ public class RootUriRequestExpectationManager implements RequestExpectationManag */ public static RequestExpectationManager forRestTemplate(RestTemplate restTemplate, RequestExpectationManager expectationManager) { - Assert.notNull(restTemplate, "RestTemplate must not be null"); + Assert.notNull(restTemplate, "'restTemplate' must not be null"); UriTemplateHandler templateHandler = restTemplate.getUriTemplateHandler(); if (templateHandler instanceof RootUriTemplateHandler rootHandler) { return new RootUriRequestExpectationManager(rootHandler.getRootUri(), expectationManager); diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java index c715b79fcd9..55130cba170 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/TestRestTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ public class TestRestTemplate { private static RestTemplateBuilder createInitialBuilder(RestTemplateBuilder builder, String username, String password, HttpClientOption... httpClientOptions) { - Assert.notNull(builder, "Builder must not be null"); + Assert.notNull(builder, "'builder' must not be null"); if (httpClientOptions != null) { ClientHttpRequestFactory requestFactory = builder.buildRequestFactory(); if (requestFactory instanceof HttpComponentsClientHttpRequestFactory) { diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClient.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClient.java index 47c46b477f4..dbc2cd2d35f 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClient.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public class LocalHostWebClient extends WebClient { private final Environment environment; public LocalHostWebClient(Environment environment) { - Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(environment, "'environment' must not be null"); this.environment = environment; } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriver.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriver.java index 60d0f7776d5..a2d7d6555c2 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriver.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriver.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,25 +35,25 @@ public class LocalHostWebConnectionHtmlUnitDriver extends WebConnectionHtmlUnitD private final Environment environment; public LocalHostWebConnectionHtmlUnitDriver(Environment environment) { - Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(environment, "'environment' must not be null"); this.environment = environment; } public LocalHostWebConnectionHtmlUnitDriver(Environment environment, boolean enableJavascript) { super(enableJavascript); - Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(environment, "'environment' must not be null"); this.environment = environment; } public LocalHostWebConnectionHtmlUnitDriver(Environment environment, BrowserVersion browserVersion) { super(browserVersion); - Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(environment, "'environment' must not be null"); this.environment = environment; } public LocalHostWebConnectionHtmlUnitDriver(Environment environment, Capabilities capabilities) { super(capabilities); - Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(environment, "'environment' must not be null"); this.environment = environment; } diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AnnotatedClassFinderTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AnnotatedClassFinderTests.java index e0da18ec126..0d760525d9d 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AnnotatedClassFinderTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AnnotatedClassFinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,13 +37,13 @@ class AnnotatedClassFinderTests { @Test void findFromClassWhenSourceIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> this.finder.findFromClass((Class) null)) - .withMessageContaining("Source must not be null"); + .withMessageContaining("'source' must not be null"); } @Test void findFromPackageWhenSourceIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> this.finder.findFromPackage((String) null)) - .withMessageContaining("Source must not be null"); + .withMessageContaining("'source' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java index 8547e0f2ca3..d4455c55a44 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProviderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,14 +64,14 @@ class ApplicationContextAssertProviderTests { void getWhenTypeIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy( () -> ApplicationContextAssertProvider.get(null, ApplicationContext.class, this.mockContextSupplier)) - .withMessageContaining("Type must not be null"); + .withMessageContaining("'type' must not be null"); } @Test void getWhenTypeIsClassShouldThrowException() { assertThatIllegalArgumentException().isThrownBy( () -> ApplicationContextAssertProvider.get(null, ApplicationContext.class, this.mockContextSupplier)) - .withMessageContaining("Type must not be null"); + .withMessageContaining("'type' must not be null"); } @Test @@ -79,7 +79,7 @@ class ApplicationContextAssertProviderTests { assertThatIllegalArgumentException() .isThrownBy(() -> ApplicationContextAssertProvider.get(TestAssertProviderApplicationContextClass.class, ApplicationContext.class, this.mockContextSupplier)) - .withMessageContaining("Type must be an interface"); + .withMessageContaining("'type' must be an interface"); } @Test @@ -87,7 +87,7 @@ class ApplicationContextAssertProviderTests { assertThatIllegalArgumentException() .isThrownBy(() -> ApplicationContextAssertProvider.get(TestAssertProviderApplicationContext.class, null, this.mockContextSupplier)) - .withMessageContaining("ContextType must not be null"); + .withMessageContaining("'contextType' must not be null"); } @Test @@ -95,7 +95,7 @@ class ApplicationContextAssertProviderTests { assertThatIllegalArgumentException() .isThrownBy(() -> ApplicationContextAssertProvider.get(TestAssertProviderApplicationContext.class, StaticApplicationContext.class, this.mockContextSupplier)) - .withMessageContaining("ContextType must be an interface"); + .withMessageContaining("'contextType' must be an interface"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java index 1990c5c6338..68beabe910f 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ class ApplicationContextAssertTests { @Test void createWhenApplicationContextIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new ApplicationContextAssert<>(null, null)) - .withMessageContaining("ApplicationContext must not be null"); + .withMessageContaining("'applicationContext' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/ContextConsumerTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/ContextConsumerTests.java index 370e9d72f85..36153bc05a7 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/ContextConsumerTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/runner/ContextConsumerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ class ContextConsumerTests { ContextConsumer consumer = (context) -> { }; assertThatIllegalArgumentException().isThrownBy(() -> consumer.andThen(null)) - .withMessage("After must not be null"); + .withMessage("'after' must not be null"); } } diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/AbstractJsonMarshalTesterTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/AbstractJsonMarshalTesterTests.java index f680b5f78a3..ba54bc5e319 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/AbstractJsonMarshalTesterTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/AbstractJsonMarshalTesterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -93,13 +93,13 @@ abstract class AbstractJsonMarshalTesterTests { void createWhenResourceLoadClassIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> createTester(null, ResolvableType.forClass(ExampleObject.class))) - .withMessageContaining("ResourceLoadClass must not be null"); + .withMessageContaining("'resourceLoadClass' must not be null"); } @Test void createWhenTypeIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> createTester(getClass(), null)) - .withMessageContaining("Type must not be null"); + .withMessageContaining("'type' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/BasicJsonTesterTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/BasicJsonTesterTests.java index 50602dd5c7f..205aebe9ee7 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/BasicJsonTesterTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/BasicJsonTesterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ class BasicJsonTesterTests { @Test void createWhenResourceLoadClassIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new BasicJsonTester(null)) - .withMessageContaining("ResourceLoadClass must not be null"); + .withMessageContaining("'resourceLoadClass' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterTests.java index 62fe8f3df95..ea192775325 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/GsonTesterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,14 +37,14 @@ class GsonTesterTests extends AbstractJsonMarshalTesterTests { @Test void initFieldsWhenTestIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> GsonTester.initFields(null, new GsonBuilder().create())) - .withMessageContaining("TestInstance must not be null"); + .withMessageContaining("'testInstance' must not be null"); } @Test void initFieldsWhenMarshallerIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> GsonTester.initFields(new InitFieldsTestClass(), (Gson) null)) - .withMessageContaining("Marshaller must not be null"); + .withMessageContaining("'marshaller' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterTests.java index 366ba5ae7bd..7be1e0964ad 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JacksonTesterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,14 +36,14 @@ class JacksonTesterTests extends AbstractJsonMarshalTesterTests { @Test void initFieldsWhenTestIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> JacksonTester.initFields(null, new ObjectMapper())) - .withMessageContaining("TestInstance must not be null"); + .withMessageContaining("'testInstance' must not be null"); } @Test void initFieldsWhenMarshallerIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> JacksonTester.initFields(new InitFieldsTestClass(), (ObjectMapper) null)) - .withMessageContaining("Marshaller must not be null"); + .withMessageContaining("'marshaller' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentTests.java index 1c3b27265e8..a9e8b456aed 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ class JsonContentTests { void createWhenResourceLoadClassIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new JsonContent(null, TYPE, JSON, Configuration.defaultConfiguration())) - .withMessageContaining("ResourceLoadClass must not be null"); + .withMessageContaining("'resourceLoadClass' must not be null"); } @Test @@ -47,14 +47,14 @@ class JsonContentTests { assertThatIllegalArgumentException() .isThrownBy( () -> new JsonContent(getClass(), TYPE, null, Configuration.defaultConfiguration())) - .withMessageContaining("JSON must not be null"); + .withMessageContaining("'json' must not be null"); } @Test void createWhenConfigurationIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new JsonContent(getClass(), TYPE, JSON, null)) - .withMessageContaining("Configuration must not be null"); + .withMessageContaining("'configuration' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java index 524196cea30..9e77a73a3fc 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonbTesterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,14 +37,14 @@ class JsonbTesterTests extends AbstractJsonMarshalTesterTests { @Test void initFieldsWhenTestIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> JsonbTester.initFields(null, JsonbBuilder.create())) - .withMessageContaining("TestInstance must not be null"); + .withMessageContaining("'testInstance' must not be null"); } @Test void initFieldsWhenMarshallerIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> JsonbTester.initFields(new InitFieldsTestClass(), (Jsonb) null)) - .withMessageContaining("Marshaller must not be null"); + .withMessageContaining("'marshaller' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentTests.java index 8d83219da63..ce34a9b3fba 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/json/ObjectContentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ class ObjectContentTests { @Test void createWhenObjectIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new ObjectContent(TYPE, null)) - .withMessageContaining("Object must not be null"); + .withMessageContaining("'object' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockDefinitionTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockDefinitionTests.java index f349e9e8a46..8c9483c3479 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockDefinitionTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/MockDefinitionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ class MockDefinitionTests { void classToMockMustNotBeNull() { assertThatIllegalArgumentException() .isThrownBy(() -> new MockDefinition(null, null, null, null, false, null, null)) - .withMessageContaining("TypeToMock must not be null"); + .withMessageContaining("'typeToMock' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyDefinitionTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyDefinitionTests.java index 8f5cea4d6f0..660ceb107bd 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyDefinitionTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/mock/mockito/SpyDefinitionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ class SpyDefinitionTests { @Test void classToSpyMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new SpyDefinition(null, null, null, true, null)) - .withMessageContaining("TypeToSpy must not be null"); + .withMessageContaining("'typeToSpy' must not be null"); } @Test @@ -84,7 +84,7 @@ class SpyDefinitionTests { void createSpyWhenNullInstanceShouldThrowException() { SpyDefinition definition = new SpyDefinition("name", REAL_SERVICE_TYPE, MockReset.BEFORE, true, null); assertThatIllegalArgumentException().isThrownBy(() -> definition.createSpy(null)) - .withMessageContaining("Instance must not be null"); + .withMessageContaining("'instance' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandlerTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandlerTests.java index 48b63138376..57370a9df58 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandlerTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,21 +43,21 @@ class LocalHostUriTemplateHandlerTests { @Test void createWhenEnvironmentIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new LocalHostUriTemplateHandler(null)) - .withMessageContaining("Environment must not be null"); + .withMessageContaining("'environment' must not be null"); } @Test void createWhenSchemeIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new LocalHostUriTemplateHandler(new MockEnvironment(), null)) - .withMessageContaining("Scheme must not be null"); + .withMessageContaining("'scheme' must not be null"); } @Test void createWhenHandlerIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new LocalHostUriTemplateHandler(new MockEnvironment(), "http", null)) - .withMessageContaining("Handler must not be null"); + .withMessageContaining("'handler' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizerTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizerTests.java index 0dffb76514a..82469c395fe 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizerTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/MockServerRestClientCustomizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,7 @@ class MockServerRestClientCustomizerTests { void createWhenExpectationManagerClassIsNullShouldThrowException() { Class expectationManager = null; assertThatIllegalArgumentException().isThrownBy(() -> new MockServerRestClientCustomizer(expectationManager)) - .withMessageContaining("ExpectationManager must not be null"); + .withMessageContaining("'expectationManager' must not be null"); } @Test @@ -67,7 +67,7 @@ class MockServerRestClientCustomizerTests { Supplier expectationManagerSupplier = null; assertThatIllegalArgumentException() .isThrownBy(() -> new MockServerRestClientCustomizer(expectationManagerSupplier)) - .withMessageContaining("ExpectationManagerSupplier must not be null"); + .withMessageContaining("'expectationManagerSupplier' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizerTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizerTests.java index 8f08c63abc9..c6787d202c7 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizerTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/MockServerRestTemplateCustomizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ class MockServerRestTemplateCustomizerTests { void createWhenExpectationManagerClassIsNullShouldThrowException() { Class expectationManager = null; assertThatIllegalArgumentException().isThrownBy(() -> new MockServerRestTemplateCustomizer(expectationManager)) - .withMessageContaining("ExpectationManager must not be null"); + .withMessageContaining("'expectationManager' must not be null"); } @Test @@ -70,7 +70,7 @@ class MockServerRestTemplateCustomizerTests { Supplier expectationManagerSupplier = null; assertThatIllegalArgumentException() .isThrownBy(() -> new MockServerRestTemplateCustomizer(expectationManagerSupplier)) - .withMessageContaining("ExpectationManagerSupplier must not be null"); + .withMessageContaining("'expectationManagerSupplier' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/RootUriRequestExpectationManagerTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/RootUriRequestExpectationManagerTests.java index a818798407f..69b70476112 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/RootUriRequestExpectationManagerTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/RootUriRequestExpectationManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,13 +67,13 @@ class RootUriRequestExpectationManagerTests { @Test void createWhenRootUriIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new RootUriRequestExpectationManager(null, this.delegate)) - .withMessageContaining("RootUri must not be null"); + .withMessageContaining("'rootUri' must not be null"); } @Test void createWhenExpectationManagerIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new RootUriRequestExpectationManager(this.uri, null)) - .withMessageContaining("ExpectationManager must not be null"); + .withMessageContaining("'expectationManager' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClientTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClientTests.java index c3299a41751..84e0ff4f298 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClientTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClientTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ class LocalHostWebClientTests { @Test void createWhenEnvironmentIsNullWillThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new LocalHostWebClient(null)) - .withMessageContaining("Environment must not be null"); + .withMessageContaining("'environment' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriverTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriverTests.java index 9b159132054..21e787a83c0 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriverTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/webdriver/LocalHostWebConnectionHtmlUnitDriverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,20 +64,20 @@ class LocalHostWebConnectionHtmlUnitDriverTests { @Test void createWhenEnvironmentIsNullWillThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new LocalHostWebConnectionHtmlUnitDriver(null)) - .withMessageContaining("Environment must not be null"); + .withMessageContaining("'environment' must not be null"); } @Test void createWithJavascriptFlagWhenEnvironmentIsNullWillThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> new LocalHostWebConnectionHtmlUnitDriver(null, true)) - .withMessageContaining("Environment must not be null"); + .withMessageContaining("'environment' must not be null"); } @Test void createWithBrowserVersionWhenEnvironmentIsNullWillThrowException() { assertThatIllegalArgumentException() .isThrownBy(() -> new LocalHostWebConnectionHtmlUnitDriver(null, BrowserVersion.CHROME)) - .withMessageContaining("Environment must not be null"); + .withMessageContaining("'environment' must not be null"); } @Test @@ -87,7 +87,7 @@ class LocalHostWebConnectionHtmlUnitDriverTests { given(capabilities.getBrowserVersion()).willReturn("chrome"); assertThatIllegalArgumentException() .isThrownBy(() -> new LocalHostWebConnectionHtmlUnitDriver(null, capabilities)) - .withMessageContaining("Environment must not be null"); + .withMessageContaining("'environment' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/properties/TestcontainersPropertySource.java b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/properties/TestcontainersPropertySource.java index f9a5730242d..0f556e50415 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/properties/TestcontainersPropertySource.java +++ b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/properties/TestcontainersPropertySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ public class TestcontainersPropertySource extends MapPropertySource { DynamicPropertyRegistryInjection registryInjection) { super(NAME, Collections.unmodifiableMap(valueSuppliers)); this.registry = (name, valueSupplier) -> { - Assert.hasText(name, "'name' must not be null or blank"); + Assert.hasText(name, "'name' must not be empty"); DynamicPropertyRegistryInjectionException.throwIfNecessary(name, registryInjection); Assert.notNull(valueSupplier, "'valueSupplier' must not be null"); valueSuppliers.put(name, valueSupplier); diff --git a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/ContainerConnectionDetailsFactory.java b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/ContainerConnectionDetailsFactory.java index 14518b982d8..ccf6bedd742 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/ContainerConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/ContainerConnectionDetailsFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,7 +92,7 @@ public abstract class ContainerConnectionDetailsFactory, * @since 3.4.0 */ protected ContainerConnectionDetailsFactory(List connectionNames, String... requiredClassNames) { - Assert.notEmpty(connectionNames, "ConnectionNames must contain at least one name"); + Assert.notEmpty(connectionNames, "'connectionNames' must not be empty"); this.connectionNames = connectionNames; this.requiredClassNames = requiredClassNames; } @@ -171,7 +171,7 @@ public abstract class ContainerConnectionDetailsFactory, * @param source the source {@link ContainerConnectionSource} */ protected ContainerConnectionDetails(ContainerConnectionSource source) { - Assert.notNull(source, "Source must not be null"); + Assert.notNull(source, "'source' must not be null"); this.source = source; } diff --git a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/FieldOrigin.java b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/FieldOrigin.java index 3205aa4eb9f..2bccf69beb1 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/FieldOrigin.java +++ b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/FieldOrigin.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ class FieldOrigin implements Origin { private final Field field; FieldOrigin(Field field) { - Assert.notNull(field, "Field must not be null"); + Assert.notNull(field, "'field' must not be null"); this.field = field; } diff --git a/spring-boot-project/spring-boot-testcontainers/src/test/java/org/springframework/boot/testcontainers/service/connection/FieldOriginTests.java b/spring-boot-project/spring-boot-testcontainers/src/test/java/org/springframework/boot/testcontainers/service/connection/FieldOriginTests.java index d3b89a8d614..c0e0a69ded2 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/test/java/org/springframework/boot/testcontainers/service/connection/FieldOriginTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/test/java/org/springframework/boot/testcontainers/service/connection/FieldOriginTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ class FieldOriginTests { @Test void createWhenFieldIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new FieldOrigin(null)) - .withMessage("Field must not be null"); + .withMessage("'field' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildOwner.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildOwner.java index a027d7237cd..077cd9eb7b1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildOwner.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildOwner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,7 +84,7 @@ class BuildOwner implements Owner { * @throws IllegalStateException if the env does not contain the correct CNB variables */ static BuildOwner fromEnv(Map env) { - Assert.notNull(env, "Env must not be null"); + Assert.notNull(env, "'env' must not be null"); return new BuildOwner(env); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java index f17e717249f..2011bf6a9a8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,8 +108,8 @@ public class BuildRequest { private final ImagePlatform platform; BuildRequest(ImageReference name, Function applicationContent) { - Assert.notNull(name, "Name must not be null"); - Assert.notNull(applicationContent, "ApplicationContent must not be null"); + Assert.notNull(name, "'name' must not be null"); + Assert.notNull(applicationContent, "'applicationContent' must not be null"); this.name = name.inTaggedForm(); this.applicationContent = applicationContent; this.builder = DEFAULT_BUILDER; @@ -170,7 +170,7 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withBuilder(ImageReference builder) { - Assert.notNull(builder, "Builder must not be null"); + Assert.notNull(builder, "'builder' must not be null"); return new BuildRequest(this.name, this.applicationContent, builder.inTaggedOrDigestForm(), this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, @@ -211,7 +211,7 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withCreator(Creator creator) { - Assert.notNull(creator, "Creator must not be null"); + Assert.notNull(creator, "'creator' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, @@ -225,8 +225,8 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withEnv(String name, String value) { - Assert.hasText(name, "Name must not be empty"); - Assert.hasText(value, "Value must not be empty"); + Assert.hasText(name, "'name' must not be empty"); + Assert.hasText(value, "'value' must not be empty"); Map env = new LinkedHashMap<>(this.env); env.put(name, value); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, @@ -242,7 +242,7 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withEnv(Map env) { - Assert.notNull(env, "Env must not be null"); + Assert.notNull(env, "'env' must not be null"); Map updatedEnv = new LinkedHashMap<>(this.env); updatedEnv.putAll(env); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, @@ -307,7 +307,7 @@ public class BuildRequest { * @since 2.5.0 */ public BuildRequest withBuildpacks(BuildpackReference... buildpacks) { - Assert.notEmpty(buildpacks, "Buildpacks must not be empty"); + Assert.notEmpty(buildpacks, "'buildpacks' must not be empty"); return withBuildpacks(Arrays.asList(buildpacks)); } @@ -318,7 +318,7 @@ public class BuildRequest { * @since 2.5.0 */ public BuildRequest withBuildpacks(List buildpacks) { - Assert.notNull(buildpacks, "Buildpacks must not be null"); + Assert.notNull(buildpacks, "'buildpacks' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache, this.launchCache, @@ -332,7 +332,7 @@ public class BuildRequest { * @since 2.5.0 */ public BuildRequest withBindings(Binding... bindings) { - Assert.notEmpty(bindings, "Bindings must not be empty"); + Assert.notEmpty(bindings, "'bindings' must not be empty"); return withBindings(Arrays.asList(bindings)); } @@ -343,7 +343,7 @@ public class BuildRequest { * @since 2.5.0 */ public BuildRequest withBindings(List bindings) { - Assert.notNull(bindings, "Bindings must not be null"); + Assert.notNull(bindings, "'bindings' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, bindings, this.network, this.tags, this.buildWorkspace, this.buildCache, @@ -369,7 +369,7 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withTags(ImageReference... tags) { - Assert.notEmpty(tags, "Tags must not be empty"); + Assert.notEmpty(tags, "'tags' must not be empty"); return withTags(Arrays.asList(tags)); } @@ -379,7 +379,7 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withTags(List tags) { - Assert.notNull(tags, "Tags must not be null"); + Assert.notNull(tags, "'tags' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, tags, this.buildWorkspace, this.buildCache, @@ -393,7 +393,7 @@ public class BuildRequest { * @since 3.2.0 */ public BuildRequest withBuildWorkspace(Cache buildWorkspace) { - Assert.notNull(buildWorkspace, "BuildWorkspace must not be null"); + Assert.notNull(buildWorkspace, "'buildWorkspace' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, this.tags, buildWorkspace, this.buildCache, @@ -406,7 +406,7 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withBuildCache(Cache buildCache) { - Assert.notNull(buildCache, "BuildCache must not be null"); + Assert.notNull(buildCache, "'buildCache' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, buildCache, @@ -419,7 +419,7 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withLaunchCache(Cache launchCache) { - Assert.notNull(launchCache, "LaunchCache must not be null"); + Assert.notNull(launchCache, "'launchCache' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache, @@ -432,7 +432,7 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withCreatedDate(String createdDate) { - Assert.notNull(createdDate, "CreatedDate must not be null"); + Assert.notNull(createdDate, "'createdDate' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache, @@ -458,7 +458,7 @@ public class BuildRequest { * @return an updated build request */ public BuildRequest withApplicationDirectory(String applicationDirectory) { - Assert.notNull(applicationDirectory, "ApplicationDirectory must not be null"); + Assert.notNull(applicationDirectory, "'applicationDirectory' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache, @@ -472,7 +472,7 @@ public class BuildRequest { * @since 3.2.0 */ public BuildRequest withSecurityOptions(List securityOptions) { - Assert.notNull(securityOptions, "SecurityOption must not be null"); + Assert.notNull(securityOptions, "'securityOptions' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache, @@ -486,7 +486,7 @@ public class BuildRequest { * @since 3.4.0 */ public BuildRequest withImagePlatform(String platform) { - Assert.notNull(platform, "Platform must not be null"); + Assert.notNull(platform, "'platform' must not be null"); return new BuildRequest(this.name, this.applicationContent, this.builder, this.trustBuilder, this.runImage, this.creator, this.env, this.cleanCache, this.verboseLogging, this.pullPolicy, this.publish, this.buildpacks, this.bindings, this.network, this.tags, this.buildWorkspace, this.buildCache, @@ -715,9 +715,9 @@ public class BuildRequest { } private static void assertJarFile(File jarFile) { - Assert.notNull(jarFile, "JarFile must not be null"); - Assert.isTrue(jarFile.exists(), "JarFile must exist"); - Assert.isTrue(jarFile.isFile(), "JarFile must be a file"); + Assert.notNull(jarFile, "'jarFile' must not be null"); + Assert.isTrue(jarFile.exists(), "'jarFile' must exist"); + Assert.isTrue(jarFile.isFile(), "'jarFile' must be a file"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Builder.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Builder.java index 09baf1db329..72234aa5a1c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Builder.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Builder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,14 +90,14 @@ public class Builder { } Builder(BuildLog log, DockerApi docker, DockerConfiguration dockerConfiguration) { - Assert.notNull(log, "Log must not be null"); + Assert.notNull(log, "'log' must not be null"); this.log = log; this.docker = docker; this.dockerConfiguration = dockerConfiguration; } public void build(BuildRequest request) throws DockerEngineException, IOException { - Assert.notNull(request, "Request must not be null"); + Assert.notNull(request, "'request' must not be null"); this.log.start(request); validateBindings(request.getBindings()); String domain = request.getBuilder().getDomain(); @@ -230,8 +230,8 @@ public class Builder { } Image fetchImage(ImageType type, ImageReference reference) throws IOException { - Assert.notNull(type, "Type must not be null"); - Assert.notNull(reference, "Reference must not be null"); + Assert.notNull(type, "'type' must not be null"); + Assert.notNull(reference, "'reference' must not be null"); Assert.state(this.authHeader == null || reference.getDomain().equals(this.domain), () -> String.format("%s '%s' must be pulled from the '%s' authenticated registry", StringUtils.capitalize(type.getDescription()), reference, this.domain)); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuilderMetadata.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuilderMetadata.java index 3b566cbf0fb..2d5a54bb631 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuilderMetadata.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuilderMetadata.java @@ -145,7 +145,7 @@ class BuilderMetadata extends MappedObject { * @throws IOException on IO error */ static BuilderMetadata fromImage(Image image) throws IOException { - Assert.notNull(image, "Image must not be null"); + Assert.notNull(image, "'image' must not be null"); return fromImageConfig(image.getConfig()); } @@ -156,7 +156,7 @@ class BuilderMetadata extends MappedObject { * @throws IOException on IO error */ static BuilderMetadata fromImageConfig(ImageConfig imageConfig) throws IOException { - Assert.notNull(imageConfig, "ImageConfig must not be null"); + Assert.notNull(imageConfig, "'imageConfig' must not be null"); String json = imageConfig.getLabels().get(LABEL_NAME); Assert.state(json != null, () -> "No '" + LABEL_NAME + "' label found in image config labels '" + StringUtils.collectionToCommaDelimitedString(imageConfig.getLabels().keySet()) + "'"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadata.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadata.java index 093c93bc8ba..ac9f54591e9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadata.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadata.java @@ -64,7 +64,7 @@ final class BuildpackLayersMetadata extends MappedObject { * @throws IOException on IO error */ static BuildpackLayersMetadata fromImage(Image image) throws IOException { - Assert.notNull(image, "Image must not be null"); + Assert.notNull(image, "'image' must not be null"); return fromImageConfig(image.getConfig()); } @@ -75,7 +75,7 @@ final class BuildpackLayersMetadata extends MappedObject { * @throws IOException on IO error */ static BuildpackLayersMetadata fromImageConfig(ImageConfig imageConfig) throws IOException { - Assert.notNull(imageConfig, "ImageConfig must not be null"); + Assert.notNull(imageConfig, "'imageConfig' must not be null"); String json = imageConfig.getLabels().get(LABEL_NAME); Assert.state(json != null, () -> "No '" + LABEL_NAME + "' label found in image config labels '" + StringUtils.collectionToCommaDelimitedString(imageConfig.getLabels().keySet()) + "'"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackMetadata.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackMetadata.java index f6d6b77213f..79063567f0e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackMetadata.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackMetadata.java @@ -81,7 +81,7 @@ final class BuildpackMetadata extends MappedObject { * @throws IOException on IO error */ static BuildpackMetadata fromImage(Image image) throws IOException { - Assert.notNull(image, "Image must not be null"); + Assert.notNull(image, "'image' must not be null"); return fromImageConfig(image.getConfig()); } @@ -92,7 +92,7 @@ final class BuildpackMetadata extends MappedObject { * @throws IOException on IO error */ static BuildpackMetadata fromImageConfig(ImageConfig imageConfig) throws IOException { - Assert.notNull(imageConfig, "ImageConfig must not be null"); + Assert.notNull(imageConfig, "'imageConfig' must not be null"); String json = imageConfig.getLabels().get(LABEL_NAME); Assert.state(json != null, () -> "No '" + LABEL_NAME + "' label found in image config labels '" + StringUtils.collectionToCommaDelimitedString(imageConfig.getLabels().keySet()) + "'"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackReference.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackReference.java index ebbf7da1327..a555672b9c5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackReference.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,7 +94,7 @@ public final class BuildpackReference { * @return a new {@link BuildpackReference} */ public static BuildpackReference of(String value) { - Assert.hasText(value, "Value must not be empty"); + Assert.hasText(value, "'value' must not be empty"); return new BuildpackReference(value); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackResolvers.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackResolvers.java index 1883df4264c..ec64d0a9b59 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackResolvers.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildpackResolvers.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ final class BuildpackResolvers { * @return a {@link Buildpacks} instance */ static Buildpacks resolveAll(BuildpackResolverContext context, Collection references) { - Assert.notNull(context, "Context must not be null"); + Assert.notNull(context, "'context' must not be null"); if (CollectionUtils.isEmpty(references)) { return Buildpacks.EMPTY; } @@ -67,7 +67,7 @@ final class BuildpackResolvers { } private static Buildpack resolve(BuildpackResolverContext context, BuildpackReference reference) { - Assert.notNull(reference, "Reference must not be null"); + Assert.notNull(reference, "'reference' must not be null"); for (BuildpackResolver resolver : resolvers) { Buildpack buildpack = resolver.resolve(context, reference); if (buildpack != null) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Cache.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Cache.java index 704a3418d39..53566f4e060 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Cache.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Cache.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,7 +85,7 @@ public class Cache { * @return a new cache instance */ public static Cache volume(String name) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); return new Volume(VolumeName.of(name)); } @@ -95,7 +95,7 @@ public class Cache { * @return a new cache instance */ public static Cache volume(VolumeName name) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); return new Volume(name); } @@ -105,7 +105,7 @@ public class Cache { * @return a new cache instance */ public static Cache bind(String source) { - Assert.notNull(source, "Source must not be null"); + Assert.notNull(source, "'source' must not be null"); return new Bind(source); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Creator.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Creator.java index d4d38148a38..a6dee5fee26 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Creator.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Creator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ public class Creator { * @return a new creator instance */ public static Creator withVersion(String version) { - Assert.notNull(version, "Version must not be null"); + Assert.notNull(version, "'version' must not be null"); return new Creator(version); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/LifecycleVersion.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/LifecycleVersion.java index 3db3f48f66c..9936c6323b6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/LifecycleVersion.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/LifecycleVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,19 +120,17 @@ class LifecycleVersion implements Comparable { * @throws IllegalArgumentException if the value could not be parsed */ static LifecycleVersion parse(String value) { - Assert.hasText(value, "Value must not be empty"); - if (value.startsWith("v") || value.startsWith("V")) { - value = value.substring(1); - } - String[] components = value.split("\\."); - Assert.isTrue(components.length <= 3, "Malformed version number '" + value + "'"); + Assert.hasText(value, "'value' must not be empty"); + String withoutPrefix = (value.startsWith("v") || value.startsWith("V")) ? value.substring(1) : value; + String[] components = withoutPrefix.split("\\."); + Assert.isTrue(components.length <= 3, () -> "'value' [%s] must be a valid version number".formatted(value)); int[] versions = new int[3]; for (int i = 0; i < components.length; i++) { try { versions[i] = Integer.parseInt(components[i]); } catch (NumberFormatException ex) { - throw new IllegalArgumentException("Malformed version number '" + value + "'", ex); + throw new IllegalArgumentException("'value' [" + value + "] must be a valid version number", ex); } } return new LifecycleVersion(versions[0], versions[1], versions[2]); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/StackId.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/StackId.java index 327ca42fada..6ed3903e7fb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/StackId.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/StackId.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +67,7 @@ class StackId { * @return the extracted stack ID */ static StackId fromImage(Image image) { - Assert.notNull(image, "Image must not be null"); + Assert.notNull(image, "'image' must not be null"); return fromImageConfig(image.getConfig()); } @@ -87,7 +87,7 @@ class StackId { * @return a new stack ID instance */ static StackId of(String value) { - Assert.hasText(value, "Value must not be empty"); + Assert.hasText(value, "'value' must not be empty"); return new StackId(value); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java index e5659f9bce4..6e89da9717b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -219,8 +219,8 @@ public class DockerApi { */ public Image pull(ImageReference reference, ImagePlatform platform, UpdateListener listener, String registryAuth) throws IOException { - Assert.notNull(reference, "Reference must not be null"); - Assert.notNull(listener, "Listener must not be null"); + Assert.notNull(reference, "'reference' must not be null"); + Assert.notNull(listener, "'listener' must not be null"); URI createUri = (platform != null) ? buildUrl(PLATFORM_API_VERSION, "/images/create", "fromImage", reference, "platform", platform) : buildUrl("/images/create", "fromImage", reference); @@ -249,8 +249,8 @@ public class DockerApi { */ public void push(ImageReference reference, UpdateListener listener, String registryAuth) throws IOException { - Assert.notNull(reference, "Reference must not be null"); - Assert.notNull(listener, "Listener must not be null"); + Assert.notNull(reference, "'reference' must not be null"); + Assert.notNull(listener, "'listener' must not be null"); URI pushUri = buildUrl("/images/" + reference + "/push"); ErrorCaptureUpdateListener errorListener = new ErrorCaptureUpdateListener(); listener.onStart(); @@ -274,8 +274,8 @@ public class DockerApi { * @throws IOException on IO error */ public void load(ImageArchive archive, UpdateListener listener) throws IOException { - Assert.notNull(archive, "Archive must not be null"); - Assert.notNull(listener, "Listener must not be null"); + Assert.notNull(archive, "'archive' must not be null"); + Assert.notNull(listener, "'listener' must not be null"); URI loadUri = buildUrl("/images/load"); LoadImageUpdateListener streamListener = new LoadImageUpdateListener(archive); listener.onStart(); @@ -305,8 +305,8 @@ public class DockerApi { */ @Deprecated(since = "3.2.6", forRemoval = true) public void exportLayerFiles(ImageReference reference, IOBiConsumer exports) throws IOException { - Assert.notNull(reference, "Reference must not be null"); - Assert.notNull(exports, "Exports must not be null"); + Assert.notNull(reference, "'reference' must not be null"); + Assert.notNull(exports, "'exports' must not be null"); exportLayers(reference, (name, archive) -> { Path path = Files.createTempFile("docker-export-layer-files-", null); try { @@ -330,8 +330,8 @@ public class DockerApi { */ public void exportLayers(ImageReference reference, IOBiConsumer exports) throws IOException { - Assert.notNull(reference, "Reference must not be null"); - Assert.notNull(exports, "Exports must not be null"); + Assert.notNull(reference, "'reference' must not be null"); + Assert.notNull(exports, "'exports' must not be null"); URI uri = buildUrl("/images/" + reference + "/get"); try (Response response = http().get(uri)) { try (ExportedImageTar exportedImageTar = new ExportedImageTar(reference, response.getContent())) { @@ -347,7 +347,7 @@ public class DockerApi { * @throws IOException on IO error */ public void remove(ImageReference reference, boolean force) throws IOException { - Assert.notNull(reference, "Reference must not be null"); + Assert.notNull(reference, "'reference' must not be null"); Collection params = force ? FORCE_PARAMS : Collections.emptySet(); URI uri = buildUrl("/images/" + reference, params); http().delete(uri).close(); @@ -364,7 +364,7 @@ public class DockerApi { } private Image inspect(ApiVersion apiVersion, ImageReference reference) throws IOException { - Assert.notNull(reference, "Reference must not be null"); + Assert.notNull(reference, "'reference' must not be null"); URI imageUri = buildUrl(apiVersion, "/images/" + reference + "/json"); try (Response response = http().get(imageUri)) { return Image.of(response.getContent()); @@ -372,8 +372,8 @@ public class DockerApi { } public void tag(ImageReference sourceReference, ImageReference targetReference) throws IOException { - Assert.notNull(sourceReference, "SourceReference must not be null"); - Assert.notNull(targetReference, "TargetReference must not be null"); + Assert.notNull(sourceReference, "'sourceReference' must not be null"); + Assert.notNull(targetReference, "'targetReference' must not be null"); String tag = targetReference.getTag(); String path = "/images/" + sourceReference + "/tag"; URI uri = (tag != null) ? buildUrl(path, "repo", targetReference.inTaglessForm(), "tag", tag) @@ -402,8 +402,8 @@ public class DockerApi { */ public ContainerReference create(ContainerConfig config, ImagePlatform platform, ContainerContent... contents) throws IOException { - Assert.notNull(config, "Config must not be null"); - Assert.noNullElements(contents, "Contents must not contain null elements"); + Assert.notNull(config, "'config' must not be null"); + Assert.noNullElements(contents, "'contents' must not contain null elements"); ContainerReference containerReference = createContainer(config, platform); for (ContainerContent content : contents) { uploadContainerContent(containerReference, content); @@ -432,7 +432,7 @@ public class DockerApi { * @throws IOException on IO error */ public void start(ContainerReference reference) throws IOException { - Assert.notNull(reference, "Reference must not be null"); + Assert.notNull(reference, "'reference' must not be null"); URI uri = buildUrl("/containers/" + reference + "/start"); http().post(uri).close(); } @@ -444,8 +444,8 @@ public class DockerApi { * @throws IOException on IO error */ public void logs(ContainerReference reference, UpdateListener listener) throws IOException { - Assert.notNull(reference, "Reference must not be null"); - Assert.notNull(listener, "Listener must not be null"); + Assert.notNull(reference, "'reference' must not be null"); + Assert.notNull(listener, "'listener' must not be null"); Object[] params = { "stdout", "1", "stderr", "1", "follow", "1" }; URI uri = buildUrl("/containers/" + reference + "/logs", params); listener.onStart(); @@ -466,7 +466,7 @@ public class DockerApi { * @throws IOException on IO error */ public ContainerStatus wait(ContainerReference reference) throws IOException { - Assert.notNull(reference, "Reference must not be null"); + Assert.notNull(reference, "'reference' must not be null"); URI uri = buildUrl("/containers/" + reference + "/wait"); try (Response response = http().post(uri)) { return ContainerStatus.of(response.getContent()); @@ -480,7 +480,7 @@ public class DockerApi { * @throws IOException on IO error */ public void remove(ContainerReference reference, boolean force) throws IOException { - Assert.notNull(reference, "Reference must not be null"); + Assert.notNull(reference, "'reference' must not be null"); Collection params = force ? FORCE_PARAMS : Collections.emptySet(); URI uri = buildUrl("/containers/" + reference, params); http().delete(uri).close(); @@ -503,7 +503,7 @@ public class DockerApi { * @throws IOException on IO error */ public void delete(VolumeName name, boolean force) throws IOException { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); Collection params = force ? FORCE_PARAMS : Collections.emptySet(); URI uri = buildUrl("/volumes/" + name, params); http().delete(uri).close(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/TotalProgressEvent.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/TotalProgressEvent.java index e14b5d661db..4e624d5d9ec 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/TotalProgressEvent.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/TotalProgressEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ public class TotalProgressEvent { * @param percent the progress as a percentage */ public TotalProgressEvent(int percent) { - Assert.isTrue(percent >= 0 && percent <= 100, "Percent must be in the range 0 to 100"); + Assert.isTrue(percent >= 0 && percent <= 100, "'percent' must be in the range 0 to 100"); this.percent = percent; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfiguration.java index fa47c349fbd..9a650d42bda 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfiguration.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,13 +64,13 @@ public final class DockerConfiguration { } public DockerConfiguration withHost(String address, boolean secure, String certificatePath) { - Assert.notNull(address, "Address must not be null"); + Assert.notNull(address, "'address' must not be null"); return new DockerConfiguration(DockerHostConfiguration.forAddress(address, secure, certificatePath), this.builderAuthentication, this.publishAuthentication, this.bindHostToBuilder); } public DockerConfiguration withContext(String context) { - Assert.notNull(context, "Context must not be null"); + Assert.notNull(context, "'context' must not be null"); return new DockerConfiguration(DockerHostConfiguration.forContext(context), this.builderAuthentication, this.publishAuthentication, this.bindHostToBuilder); } @@ -88,22 +88,22 @@ public final class DockerConfiguration { public DockerConfiguration withBuilderRegistryUserAuthentication(String username, String password, String url, String email) { - Assert.notNull(username, "Username must not be null"); - Assert.notNull(password, "Password must not be null"); + Assert.notNull(username, "'username' must not be null"); + Assert.notNull(password, "'password' must not be null"); return new DockerConfiguration(this.host, new DockerRegistryUserAuthentication(username, password, url, email), this.publishAuthentication, this.bindHostToBuilder); } public DockerConfiguration withPublishRegistryTokenAuthentication(String token) { - Assert.notNull(token, "Token must not be null"); + Assert.notNull(token, "'token' must not be null"); return new DockerConfiguration(this.host, this.builderAuthentication, new DockerRegistryTokenAuthentication(token), this.bindHostToBuilder); } public DockerConfiguration withPublishRegistryUserAuthentication(String username, String password, String url, String email) { - Assert.notNull(username, "Username must not be null"); - Assert.notNull(password, "Password must not be null"); + Assert.notNull(username, "'username' must not be null"); + Assert.notNull(password, "'password' must not be null"); return new DockerConfiguration(this.host, this.builderAuthentication, new DockerRegistryUserAuthentication(username, password, url, email), this.bindHostToBuilder); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionException.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionException.java index ec22850faa1..955c5fde151 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionException.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,8 +34,8 @@ public class DockerConnectionException extends RuntimeException { } private static String buildMessage(String host, Exception cause) { - Assert.notNull(host, "Host must not be null"); - Assert.notNull(cause, "Cause must not be null"); + Assert.notNull(host, "'host' must not be null"); + Assert.notNull(cause, "'cause' must not be null"); StringBuilder message = new StringBuilder("Connection to the Docker daemon at '" + host + "' failed"); String causeMessage = getCauseMessage(cause); if (StringUtils.hasText(causeMessage)) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerEngineException.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerEngineException.java index e521f4a8afa..d2569818686 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerEngineException.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/DockerEngineException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,8 +83,8 @@ public class DockerEngineException extends RuntimeException { private static String buildMessage(String host, URI uri, int statusCode, String reasonPhrase, Errors errors, Message responseMessage) { - Assert.notNull(host, "Host must not be null"); - Assert.notNull(uri, "URI must not be null"); + Assert.notNull(host, "'host' must not be null"); + Assert.notNull(uri, "'uri' must not be null"); StringBuilder message = new StringBuilder( "Docker API call to '" + host + uri + "' failed with status code " + statusCode); if (StringUtils.hasLength(reasonPhrase)) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransport.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransport.java index 718912e2a38..502b710820e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransport.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransport.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,8 +61,8 @@ abstract class HttpClientTransport implements HttpTransport { private final HttpHost host; protected HttpClientTransport(HttpClient client, HttpHost host) { - Assert.notNull(client, "Client must not be null"); - Assert.notNull(host, "Host must not be null"); + Assert.notNull(client, "'client' must not be null"); + Assert.notNull(host, "'host' must not be null"); this.client = client; this.host = host; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ApiVersion.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ApiVersion.java index 662680f4bd4..b7316bc62a0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ApiVersion.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ApiVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,16 +118,17 @@ public final class ApiVersion { * @throws IllegalArgumentException if the value could not be parsed */ public static ApiVersion parse(String value) { - Assert.hasText(value, "Value must not be empty"); + Assert.hasText(value, "'value' must not be empty"); Matcher matcher = PATTERN.matcher(value); - Assert.isTrue(matcher.matches(), () -> "Malformed version number '" + value + "'"); + Assert.isTrue(matcher.matches(), + () -> "'value' [%s] must contain a well formed version number".formatted(value)); try { int major = Integer.parseInt(matcher.group(1)); int minor = Integer.parseInt(matcher.group(2)); return new ApiVersion(major, minor); } catch (NumberFormatException ex) { - throw new IllegalArgumentException("Malformed version number '" + value + "'", ex); + throw new IllegalArgumentException("'value' must contain a well formed version number [" + value + "]", ex); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Binding.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Binding.java index 7d08240af85..caa3f1501e7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Binding.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Binding.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -110,7 +110,7 @@ public final class Binding { * @return a new {@link Binding} instance */ public static Binding of(String value) { - Assert.notNull(value, "Value must not be null"); + Assert.notNull(value, "'value' must not be null"); return new Binding(value); } @@ -121,7 +121,7 @@ public final class Binding { * @return a new {@link Binding} instance */ public static Binding from(VolumeName sourceVolume, String destination) { - Assert.notNull(sourceVolume, "SourceVolume must not be null"); + Assert.notNull(sourceVolume, "'sourceVolume' must not be null"); return from(sourceVolume.toString(), destination); } @@ -132,8 +132,8 @@ public final class Binding { * @return a new {@link Binding} instance */ public static Binding from(String source, String destination) { - Assert.notNull(source, "Source must not be null"); - Assert.notNull(destination, "Destination must not be null"); + Assert.notNull(source, "'source' must not be null"); + Assert.notNull(destination, "'destination' must not be null"); return new Binding(source + ":" + destination); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerConfig.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerConfig.java index 1ee0e19ae6f..c13e737ad81 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerConfig.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,8 +51,8 @@ public class ContainerConfig { ContainerConfig(String user, ImageReference image, String command, List args, Map labels, List bindings, Map env, String networkMode, List securityOptions) throws IOException { - Assert.notNull(image, "Image must not be null"); - Assert.hasText(command, "Command must not be empty"); + Assert.notNull(image, "'image' must not be null"); + Assert.hasText(command, "'command' must not be empty"); ObjectMapper objectMapper = SharedObjectMapper.get(); ObjectNode node = objectMapper.createObjectNode(); if (StringUtils.hasText(user)) { @@ -100,8 +100,8 @@ public class ContainerConfig { * @return a new {@link ContainerConfig} instance */ public static ContainerConfig of(ImageReference imageReference, Consumer update) { - Assert.notNull(imageReference, "ImageReference must not be null"); - Assert.notNull(update, "Update must not be null"); + Assert.notNull(imageReference, "'imageReference' must not be null"); + Assert.notNull(update, "'update' must not be null"); return new Update(imageReference).run(update); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerContent.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerContent.java index c0f5dd217d4..5a9b04b2076 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerContent.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerContent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,8 +56,8 @@ public interface ContainerContent { * @return a new {@link ContainerContent} instance */ static ContainerContent of(TarArchive archive, String destinationPath) { - Assert.notNull(archive, "Archive must not be null"); - Assert.hasText(destinationPath, "DestinationPath must not be empty"); + Assert.notNull(archive, "'archive' must not be null"); + Assert.hasText(destinationPath, "'destinationPath' must not be empty"); return new ContainerContent() { @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerReference.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerReference.java index f5a5c6ac5a3..a26d43feaad 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerReference.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ public final class ContainerReference { private final String value; private ContainerReference(String value) { - Assert.hasText(value, "Value must not be empty"); + Assert.hasText(value, "'value' must not be empty"); this.value = value; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchive.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchive.java index 8d8145ac411..81b4565f72d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchive.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchive.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -289,7 +289,7 @@ public class ImageArchive implements TarArchive { * @param layer the layer to add */ public void withNewLayer(Layer layer) { - Assert.notNull(layer, "Layer must not be null"); + Assert.notNull(layer, "'layer' must not be null"); this.newLayers.add(layer); } @@ -298,7 +298,7 @@ public class ImageArchive implements TarArchive { * @param createDate the create date */ public void withCreateDate(Instant createDate) { - Assert.notNull(createDate, "CreateDate must not be null"); + Assert.notNull(createDate, "'createDate' must not be null"); this.createDate = createDate; } @@ -307,7 +307,7 @@ public class ImageArchive implements TarArchive { * @param tag the tag */ public void withTag(ImageReference tag) { - Assert.notNull(tag, "Tag must not be null"); + Assert.notNull(tag, "'tag' must not be null"); this.tag = tag.inTaggedForm(); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageName.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageName.java index 073871c3969..fa9a85c4ad7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageName.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageName.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ public class ImageName { private final String string; ImageName(String domain, String path) { - Assert.hasText(path, "Path must not be empty"); + Assert.hasText(path, "'path' must not be empty"); this.domain = getDomainOrDefault(domain); this.name = getNameWithDefaultPath(this.domain, path); this.string = this.domain + "/" + this.name; @@ -126,13 +126,12 @@ public class ImageName { * @return an {@link ImageName} instance */ public static ImageName of(String value) { - Assert.hasText(value, "Value must not be empty"); + Assert.hasText(value, "'value' must not be empty"); String domain = parseDomain(value); String path = (domain != null) ? value.substring(domain.length() + 1) : value; Assert.isTrue(Regex.PATH.matcher(path).matches(), - () -> "Unable to parse name \"" + value + "\". " - + "Image name must be in the form '[domainHost:port/][path/]name', " - + "with 'path' and 'name' containing only [a-z0-9][.][_][-]"); + () -> "'value' [" + value + "] must be a parsable name in the form '[domainHost:port/][path/]name' (" + + "with 'path' and 'name' containing only [a-z0-9][.][_][-])"); return new ImageName(domain, path); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImagePlatform.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImagePlatform.java index d43570c117f..4b6ce2bc892 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImagePlatform.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImagePlatform.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ public class ImagePlatform { private final String variant; ImagePlatform(String os, String architecture, String variant) { - Assert.hasText(os, "OS must not be empty"); + Assert.hasText(os, "'os' must not be empty"); this.os = os; this.architecture = architecture; this.variant = variant; @@ -78,14 +78,14 @@ public class ImagePlatform { * @return an {@link ImagePlatform} instance */ public static ImagePlatform of(String value) { - Assert.hasText(value, "Value must not be empty"); + Assert.hasText(value, "'value' must not be empty"); String[] split = value.split("/+"); return switch (split.length) { case 1 -> new ImagePlatform(split[0], null, null); case 2 -> new ImagePlatform(split[0], split[1], null); case 3 -> new ImagePlatform(split[0], split[1], split[2]); default -> throw new IllegalArgumentException( - "ImagePlatform value '" + value + "' must be in the form of os[/architecture[/variant]]"); + "'value' [" + value + "] must be in the form 'os[/architecture[/variant]]'"); }; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageReference.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageReference.java index c3c263e89bf..7bf34f67bd9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageReference.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ImageReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public final class ImageReference { private final String string; private ImageReference(ImageName name, String tag, String digest) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); this.name = name; this.tag = tag; this.digest = digest; @@ -186,8 +186,10 @@ public final class ImageReference { * @return an {@link ImageName} for the jar file. */ public static ImageReference forJarFile(File jarFile) { + Assert.notNull(jarFile, "'jarFile' must not be null"); String filename = jarFile.getName(); - Assert.isTrue(filename.toLowerCase(Locale.ROOT).endsWith(".jar"), () -> "File '" + jarFile + "' is not a JAR"); + Assert.isTrue(filename.toLowerCase(Locale.ROOT).endsWith(".jar"), + () -> "'jarFile' must end with '.jar' [" + jarFile + "]"); filename = filename.substring(0, filename.length() - 4); int firstDot = filename.indexOf('.'); if (firstDot == -1) { @@ -236,7 +238,7 @@ public final class ImageReference { * @return an {@link ImageName} instance */ public static ImageReference of(String value) { - Assert.hasText(value, "Value must not be null"); + Assert.hasText(value, "'value' must not be null"); String domain = ImageName.parseDomain(value); String path = (domain != null) ? value.substring(domain.length() + 1) : value; String digest = null; @@ -261,11 +263,10 @@ public final class ImageReference { path = path.substring(0, tagSplit) + remainder; } } - Assert.isTrue(isLowerCase(path) && matchesPathRegex(path), - () -> "Unable to parse image reference \"" + value + "\". " - + "Image reference must be in the form '[domainHost:port/][path/]name[:tag][@digest]', " - + "with 'path' and 'name' containing only [a-z0-9][.][_][-]"); + () -> "'value' [" + value + "] must be an image reference in the form " + + "'[domainHost:port/][path/]name[:tag][@digest]' " + + "(with 'path' and 'name' containing only [a-z0-9][.][_][-])"); ImageName name = new ImageName(domain, path); return new ImageReference(name, tag, digest); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Layer.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Layer.java index 6d481eb12d7..78671a1faaa 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Layer.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/Layer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ public class Layer implements Content { * @throws IOException on IO error */ public static Layer of(IOConsumer layout) throws IOException { - Assert.notNull(layout, "Layout must not be null"); + Assert.notNull(layout, "'layout' must not be null"); return fromTarArchive(TarArchive.of(layout)); } @@ -82,7 +82,7 @@ public class Layer implements Content { * @throws IOException on error */ public static Layer fromTarArchive(TarArchive tarArchive) throws IOException { - Assert.notNull(tarArchive, "TarArchive must not be null"); + Assert.notNull(tarArchive, "'tarArchive' must not be null"); try { return new Layer(tarArchive); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/LayerId.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/LayerId.java index d30cc6a331a..adc0d27f285 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/LayerId.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/LayerId.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,9 +83,9 @@ public final class LayerId { * @return a new layer ID instance */ public static LayerId of(String value) { - Assert.hasText(value, "Value must not be empty"); + Assert.hasText(value, "'value' must not be empty"); int i = value.indexOf(':'); - Assert.isTrue(i >= 0, () -> "Invalid layer ID '" + value + "'"); + Assert.isTrue(i >= 0, () -> "'value' [%s] must contain a valid layer ID".formatted(value)); return new LayerId(value, value.substring(0, i), value.substring(i + 1)); } @@ -95,8 +95,8 @@ public final class LayerId { * @return a new layer ID instance */ public static LayerId ofSha256Digest(byte[] digest) { - Assert.notNull(digest, "Digest must not be null"); - Assert.isTrue(digest.length == 32, "Digest must be exactly 32 bytes"); + Assert.notNull(digest, "'digest' must not be null"); + Assert.isTrue(digest.length == 32, "'digest' must be exactly 32 bytes"); String algorithm = "sha256"; String hash = String.format("%064x", new BigInteger(1, digest)); return new LayerId(algorithm + ":" + hash, algorithm, hash); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/RandomString.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/RandomString.java index d9696d3db7f..3cf51ae9fca 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/RandomString.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/RandomString.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ final class RandomString { } static String generate(String prefix, int randomLength) { - Assert.notNull(prefix, "Prefix must not be null"); + Assert.notNull(prefix, "'prefix' must not be null"); return prefix + generateRandom(randomLength); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/VolumeName.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/VolumeName.java index 7ea8a18a1cb..d3619ddd8ba 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/VolumeName.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/VolumeName.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,10 +106,10 @@ public final class VolumeName { */ public static VolumeName basedOn(S source, Function nameExtractor, String prefix, String suffix, int digestLength) { - Assert.notNull(source, "Source must not be null"); - Assert.notNull(nameExtractor, "NameExtractor must not be null"); - Assert.notNull(prefix, "Prefix must not be null"); - Assert.notNull(suffix, "Suffix must not be null"); + Assert.notNull(source, "'source' must not be null"); + Assert.notNull(nameExtractor, "'nameExtractor' must not be null"); + Assert.notNull(prefix, "'prefix' must not be null"); + Assert.notNull(suffix, "'suffix' must not be null"); return of(prefix + getDigest(nameExtractor.apply(source), digestLength) + suffix); } @@ -125,7 +125,7 @@ public final class VolumeName { private static String asHexString(byte[] digest, int digestLength) { Assert.isTrue(digestLength <= digest.length, - () -> "DigestLength must be less than or equal to " + digest.length); + () -> "'digestLength' must be less than or equal to " + digest.length); return HexFormat.of().formatHex(digest, 0, digestLength); } @@ -135,7 +135,7 @@ public final class VolumeName { * @return a new {@link VolumeName} instance */ public static VolumeName of(String value) { - Assert.notNull(value, "Value must not be null"); + Assert.notNull(value, "'value' must not be null"); return new VolumeName(value); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/Content.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/Content.java index 911df2ad492..367dd9b4276 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/Content.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/Content.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ public interface Content { * @return a new {@link Content} instance */ static Content of(String string) { - Assert.notNull(string, "String must not be null"); + Assert.notNull(string, "'string' must not be null"); return of(string.getBytes(StandardCharsets.UTF_8)); } @@ -64,7 +64,7 @@ public interface Content { * @return a new {@link Content} instance */ static Content of(byte[] bytes) { - Assert.notNull(bytes, "Bytes must not be null"); + Assert.notNull(bytes, "'bytes' must not be null"); return of(bytes.length, () -> new ByteArrayInputStream(bytes)); } @@ -74,7 +74,7 @@ public interface Content { * @return a new {@link Content} instance */ static Content of(File file) { - Assert.notNull(file, "File must not be null"); + Assert.notNull(file, "'file' must not be null"); return of((int) file.length(), () -> new FileInputStream(file)); } @@ -86,8 +86,8 @@ public interface Content { * @return a new {@link Content} instance */ static Content of(int size, IOSupplier supplier) { - Assert.isTrue(size >= 0, "Size must not be negative"); - Assert.notNull(supplier, "Supplier must not be null"); + Assert.isTrue(size >= 0, "'size' must not be negative"); + Assert.notNull(supplier, "'supplier' must not be null"); return new Content() { @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/FilePermissions.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/FilePermissions.java index 7f63c012d82..831de4819e2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/FilePermissions.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/FilePermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ public final class FilePermissions { * @throws IOException if path permissions cannot be read */ public static int umaskForPath(Path path) throws IOException { - Assert.notNull(path, "Path must not be null"); + Assert.notNull(path, "'path' must not be null"); PosixFileAttributeView attributeView = Files.getFileAttributeView(path, PosixFileAttributeView.class); Assert.state(attributeView != null, "Unsupported file type for retrieving Posix attributes"); return posixPermissionsToUmask(attributeView.readAttributes().permissions()); @@ -59,7 +59,7 @@ public final class FilePermissions { * @return the integer representation */ public static int posixPermissionsToUmask(Collection permissions) { - Assert.notNull(permissions, "Permissions must not be null"); + Assert.notNull(permissions, "'permissions' must not be null"); int owner = permissionToUmask(permissions, PosixFilePermission.OWNER_EXECUTE, PosixFilePermission.OWNER_WRITE, PosixFilePermission.OWNER_READ); int group = permissionToUmask(permissions, PosixFilePermission.GROUP_EXECUTE, PosixFilePermission.GROUP_WRITE, diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/InspectedContent.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/InspectedContent.java index 1f42a68d3f0..6b9b9d0e370 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/InspectedContent.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/InspectedContent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,7 @@ public class InspectedContent implements Content { * @throws IOException on IO error */ public static InspectedContent of(InputStream inputStream, Inspector... inspectors) throws IOException { - Assert.notNull(inputStream, "InputStream must not be null"); + Assert.notNull(inputStream, "'inputStream' must not be null"); return of((outputStream) -> FileCopyUtils.copy(inputStream, outputStream), inspectors); } @@ -88,7 +88,7 @@ public class InspectedContent implements Content { * @throws IOException on IO error */ public static InspectedContent of(Content content, Inspector... inspectors) throws IOException { - Assert.notNull(content, "Content must not be null"); + Assert.notNull(content, "'content' must not be null"); return of(content::writeTo, inspectors); } @@ -101,7 +101,7 @@ public class InspectedContent implements Content { * @throws IOException on IO error */ public static InspectedContent of(IOConsumer writer, Inspector... inspectors) throws IOException { - Assert.notNull(writer, "Writer must not be null"); + Assert.notNull(writer, "'writer' must not be null"); InspectingOutputStream outputStream = new InspectingOutputStream(inspectors); try (outputStream) { writer.accept(outputStream); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchive.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchive.java index dcbb3229b92..c1d3b100211 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchive.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchive.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,8 +53,8 @@ public class ZipFileTarArchive implements TarArchive { * @param owner the owner of the tar entries */ public ZipFileTarArchive(File zip, Owner owner) { - Assert.notNull(zip, "Zip must not be null"); - Assert.notNull(owner, "Owner must not be null"); + Assert.notNull(zip, "'zip' must not be null"); + Assert.notNull(owner, "'owner' must not be null"); assertArchiveHasEntries(zip); this.zip = zip; this.owner = owner; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildOwnerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildOwnerTests.java index c16232cfa9d..4d04bdb22f4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildOwnerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildOwnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ class BuildOwnerTests { @Test void fromEnvWhenEnvIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> BuildOwner.fromEnv(null)) - .withMessage("Env must not be null"); + .withMessage("'env' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java index 2d5490f7285..2bf5de0ea21 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,20 +88,20 @@ class BuildRequestTests { @Test void forJarFileWhenJarFileIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> BuildRequest.forJarFile(null)) - .withMessage("JarFile must not be null"); + .withMessage("'jarFile' must not be null"); } @Test void forJarFileWhenJarFileIsMissingThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> BuildRequest.forJarFile(new File(this.tempDir, "missing.jar"))) - .withMessage("JarFile must exist"); + .withMessage("'jarFile' must exist"); } @Test void forJarFileWhenJarFileIsDirectoryThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> BuildRequest.forJarFile(this.tempDir)) - .withMessage("JarFile must be a file"); + .withMessage("'jarFile' must be a file"); } @Test @@ -217,14 +217,14 @@ class BuildRequestTests { void withEnvWhenKeyIsNullThrowsException() throws IOException { BuildRequest request = BuildRequest.forJarFile(writeTestJarFile("my-app-0.0.1.jar")); assertThatIllegalArgumentException().isThrownBy(() -> request.withEnv(null, "test")) - .withMessage("Name must not be empty"); + .withMessage("'name' must not be empty"); } @Test void withEnvWhenValueIsNullThrowsException() throws IOException { BuildRequest request = BuildRequest.forJarFile(writeTestJarFile("my-app-0.0.1.jar")); assertThatIllegalArgumentException().isThrownBy(() -> request.withEnv("test", null)) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test @@ -241,7 +241,7 @@ class BuildRequestTests { void withBuildpacksWhenBuildpacksIsNullThrowsException() throws IOException { BuildRequest request = BuildRequest.forJarFile(writeTestJarFile("my-app-0.0.1.jar")); assertThatIllegalArgumentException().isThrownBy(() -> request.withBuildpacks((List) null)) - .withMessage("Buildpacks must not be null"); + .withMessage("'buildpacks' must not be null"); } @Test @@ -258,7 +258,7 @@ class BuildRequestTests { void withBindingsWhenBindingsIsNullThrowsException() throws IOException { BuildRequest request = BuildRequest.forJarFile(writeTestJarFile("my-app-0.0.1.jar")); assertThatIllegalArgumentException().isThrownBy(() -> request.withBindings((List) null)) - .withMessage("Bindings must not be null"); + .withMessage("'bindings' must not be null"); } @Test @@ -283,7 +283,7 @@ class BuildRequestTests { void withTagsWhenTagsIsNullThrowsException() throws IOException { BuildRequest request = BuildRequest.forJarFile(writeTestJarFile("my-app-0.0.1.jar")); assertThatIllegalArgumentException().isThrownBy(() -> request.withTags((List) null)) - .withMessage("Tags must not be null"); + .withMessage("'tags' must not be null"); } @Test @@ -322,7 +322,7 @@ class BuildRequestTests { void withBuildVolumeCacheWhenCacheIsNullThrowsException() throws IOException { BuildRequest request = BuildRequest.forJarFile(writeTestJarFile("my-app-0.0.1.jar")); assertThatIllegalArgumentException().isThrownBy(() -> request.withBuildCache(null)) - .withMessage("BuildCache must not be null"); + .withMessage("'buildCache' must not be null"); } @Test @@ -345,7 +345,7 @@ class BuildRequestTests { void withLaunchVolumeCacheWhenCacheIsNullThrowsException() throws IOException { BuildRequest request = BuildRequest.forJarFile(writeTestJarFile("my-app-0.0.1.jar")); assertThatIllegalArgumentException().isThrownBy(() -> request.withLaunchCache(null)) - .withMessage("LaunchCache must not be null"); + .withMessage("'launchCache' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuilderMetadataTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuilderMetadataTests.java index 292df537fdc..5e760f87361 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuilderMetadataTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuilderMetadataTests.java @@ -90,14 +90,14 @@ class BuilderMetadataTests extends AbstractJsonTests { @Test void fromImageWhenImageIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> BuilderMetadata.fromImage(null)) - .withMessage("Image must not be null"); + .withMessage("'image' must not be null"); } @Test void fromImageWhenImageConfigIsNullThrowsException() { Image image = mock(Image.class); assertThatIllegalArgumentException().isThrownBy(() -> BuilderMetadata.fromImage(image)) - .withMessage("ImageConfig must not be null"); + .withMessage("'imageConfig' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuilderTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuilderTests.java index 22c7b57e2ab..ba440ade8c4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuilderTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuilderTests.java @@ -66,7 +66,7 @@ class BuilderTests { @Test void createWhenLogIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new Builder((BuildLog) null)) - .withMessage("Log must not be null"); + .withMessage("'log' must not be null"); } @Test @@ -79,7 +79,7 @@ class BuilderTests { void buildWhenRequestIsNullThrowsException() { Builder builder = new Builder(); assertThatIllegalArgumentException().isThrownBy(() -> builder.build(null)) - .withMessage("Request must not be null"); + .withMessage("'request' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadataTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadataTests.java index 83fdc112263..6b53ff17562 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadataTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackLayersMetadataTests.java @@ -55,14 +55,14 @@ class BuildpackLayersMetadataTests extends AbstractJsonTests { @Test void fromImageWhenImageIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> BuildpackLayersMetadata.fromImage(null)) - .withMessage("Image must not be null"); + .withMessage("'image' must not be null"); } @Test void fromImageWhenImageConfigIsNullThrowsException() { Image image = mock(Image.class); assertThatIllegalArgumentException().isThrownBy(() -> BuildpackLayersMetadata.fromImage(image)) - .withMessage("ImageConfig must not be null"); + .withMessage("'imageConfig' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackMetadataTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackMetadataTests.java index 6ca36bcdd1f..5916796df6d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackMetadataTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackMetadataTests.java @@ -49,14 +49,14 @@ class BuildpackMetadataTests extends AbstractJsonTests { @Test void fromImageWhenImageIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> BuildpackMetadata.fromImage(null)) - .withMessage("Image must not be null"); + .withMessage("'image' must not be null"); } @Test void fromImageWhenImageConfigIsNullThrowsException() { Image image = mock(Image.class); assertThatIllegalArgumentException().isThrownBy(() -> BuildpackMetadata.fromImage(image)) - .withMessage("ImageConfig must not be null"); + .withMessage("'imageConfig' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackReferenceTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackReferenceTests.java index 9fc08f4a13b..b81b9c2cc62 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackReferenceTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildpackReferenceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ class BuildpackReferenceTests { @Test void ofWhenValueIsEmptyThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> BuildpackReference.of("")) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java index 2c91342e351..78dba090070 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java @@ -166,7 +166,7 @@ class ImageBuildpackTests extends AbstractJsonTests { BuildpackReference reference = BuildpackReference.of("docker://buildpack@0.0.1"); BuildpackResolverContext resolverContext = mock(BuildpackResolverContext.class); assertThatIllegalArgumentException().isThrownBy(() -> ImageBuildpack.resolve(resolverContext, reference)) - .withMessageContaining("Unable to parse image reference \"buildpack@0.0.1\""); + .withMessageContaining("'value' [buildpack@0.0.1] must be an image reference"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/LifecycleVersionTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/LifecycleVersionTests.java index 4bd256bb750..869fcfbfc08 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/LifecycleVersionTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/LifecycleVersionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,19 +31,19 @@ class LifecycleVersionTests { @Test void parseWhenValueIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> LifecycleVersion.parse(null)) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test void parseWhenTooLongThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> LifecycleVersion.parse("v1.2.3.4")) - .withMessage("Malformed version number '1.2.3.4'"); + .withMessage("'value' [v1.2.3.4] must be a valid version number"); } @Test void parseWhenNonNumericThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> LifecycleVersion.parse("v1.2.3a")) - .withMessage("Malformed version number '1.2.3a'"); + .withMessage("'value' [v1.2.3a] must be a valid version number"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/StackIdTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/StackIdTests.java index a804b596a31..70f075b8cd2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/StackIdTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/StackIdTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ class StackIdTests { @Test void fromImageWhenImageIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> StackId.fromImage(null)) - .withMessage("Image must not be null"); + .withMessage("'image' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java index 2f717e44b62..01c406b4a68 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -194,14 +194,14 @@ class DockerApiTests { @Test void pullWhenReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.pull(null, null, this.pullListener)) - .withMessage("Reference must not be null"); + .withMessage("'reference' must not be null"); } @Test void pullWhenListenerIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.api.pull(ImageReference.of("ubuntu"), null, null)) - .withMessage("Listener must not be null"); + .withMessage("'listener' must not be null"); } @Test @@ -267,14 +267,14 @@ class DockerApiTests { @Test void pushWhenReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.push(null, this.pushListener, null)) - .withMessage("Reference must not be null"); + .withMessage("'reference' must not be null"); } @Test void pushWhenListenerIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.api.push(ImageReference.of("ubuntu"), null, null)) - .withMessage("Listener must not be null"); + .withMessage("'listener' must not be null"); } @Test @@ -302,14 +302,14 @@ class DockerApiTests { @Test void loadWhenArchiveIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.load(null, UpdateListener.none())) - .withMessage("Archive must not be null"); + .withMessage("'archive' must not be null"); } @Test void loadWhenListenerIsNullThrowsException() { ImageArchive archive = mock(ImageArchive.class); assertThatIllegalArgumentException().isThrownBy(() -> this.api.load(archive, null)) - .withMessage("Listener must not be null"); + .withMessage("'listener' must not be null"); } @Test // gh-23130 @@ -352,7 +352,7 @@ class DockerApiTests { @Test void removeWhenReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.remove(null, true)) - .withMessage("Reference must not be null"); + .withMessage("'reference' must not be null"); } @Test @@ -380,7 +380,7 @@ class DockerApiTests { @Test void inspectWhenReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.inspect(null)) - .withMessage("Reference must not be null"); + .withMessage("'reference' must not be null"); } @Test @@ -396,7 +396,7 @@ class DockerApiTests { @SuppressWarnings("removal") void exportLayersWhenReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.exportLayerFiles(null, (name, archive) -> { - })).withMessage("Reference must not be null"); + })).withMessage("'reference' must not be null"); } @Test @@ -404,7 +404,7 @@ class DockerApiTests { void exportLayersWhenExportsIsNullThrowsException() { ImageReference reference = ImageReference.of("gcr.io/paketo-buildpacks/builder:base"); assertThatIllegalArgumentException().isThrownBy(() -> this.api.exportLayerFiles(reference, null)) - .withMessage("Exports must not be null"); + .withMessage("'exports' must not be null"); } @Test @@ -490,14 +490,14 @@ class DockerApiTests { void tagWhenReferenceIsNullThrowsException() { ImageReference tag = ImageReference.of("localhost:5000/ubuntu"); assertThatIllegalArgumentException().isThrownBy(() -> this.api.tag(null, tag)) - .withMessage("SourceReference must not be null"); + .withMessage("'sourceReference' must not be null"); } @Test void tagWhenTargetIsNullThrowsException() { ImageReference reference = ImageReference.of("localhost:5000/ubuntu"); assertThatIllegalArgumentException().isThrownBy(() -> this.api.tag(reference, null)) - .withMessage("TargetReference must not be null"); + .withMessage("'targetReference' must not be null"); } @Test @@ -541,7 +541,7 @@ class DockerApiTests { @Test void createWhenConfigIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.create(null, null)) - .withMessage("Config must not be null"); + .withMessage("'config' must not be null"); } @Test @@ -628,7 +628,7 @@ class DockerApiTests { @Test void startWhenReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.start(null)) - .withMessage("Reference must not be null"); + .withMessage("'reference' must not be null"); } @Test @@ -643,14 +643,14 @@ class DockerApiTests { @Test void logsWhenReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.logs(null, UpdateListener.none())) - .withMessage("Reference must not be null"); + .withMessage("'reference' must not be null"); } @Test void logsWhenListenerIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> this.api.logs(ContainerReference.of("e90e34656806"), null)) - .withMessage("Listener must not be null"); + .withMessage("'listener' must not be null"); } @Test @@ -668,7 +668,7 @@ class DockerApiTests { @Test void waitWhenReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.wait(null)) - .withMessage("Reference must not be null"); + .withMessage("'reference' must not be null"); } @Test @@ -683,7 +683,7 @@ class DockerApiTests { @Test void removeWhenReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.remove(null, true)) - .withMessage("Reference must not be null"); + .withMessage("'reference' must not be null"); } @Test @@ -719,7 +719,7 @@ class DockerApiTests { @Test void deleteWhenNameIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> this.api.delete(null, false)) - .withMessage("Name must not be null"); + .withMessage("'name' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/TotalProgressEventTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/TotalProgressEventTests.java index 02f73667138..202eb2edaa3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/TotalProgressEventTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/TotalProgressEventTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,13 +38,13 @@ class TotalProgressEventTests { @Test void createWhenPercentLessThanZeroThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new TotalProgressEvent(-1)) - .withMessage("Percent must be in the range 0 to 100"); + .withMessage("'percent' must be in the range 0 to 100"); } @Test void createWhenEventMoreThanOneHundredThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new TotalProgressEvent(101)) - .withMessage("Percent must be in the range 0 to 100"); + .withMessage("'percent' must be in the range 0 to 100"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionExceptionTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionExceptionTests.java index 68c5546e1a9..48c73b22ba7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionExceptionTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerConnectionExceptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,13 +35,13 @@ class DockerConnectionExceptionTests { @Test void createWhenHostIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new DockerConnectionException(null, null)) - .withMessage("Host must not be null"); + .withMessage("'host' must not be null"); } @Test void createWhenCauseIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new DockerConnectionException(HOST, null)) - .withMessage("Cause must not be null"); + .withMessage("'cause' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerEngineExceptionTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerEngineExceptionTests.java index 72c3ff03213..87cadc062bb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerEngineExceptionTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/DockerEngineExceptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,14 +57,14 @@ class DockerEngineExceptionTests { void createWhenHostIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> new DockerEngineException(null, null, 404, null, NO_ERRORS, NO_MESSAGE)) - .withMessage("Host must not be null"); + .withMessage("'host' must not be null"); } @Test void createWhenUriIsNullThrowsException() { assertThatIllegalArgumentException() .isThrownBy(() -> new DockerEngineException(HOST, null, 404, null, NO_ERRORS, NO_MESSAGE)) - .withMessage("URI must not be null"); + .withMessage("'uri' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ApiVersionTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ApiVersionTests.java index d06d315eebf..f3339d6cf7b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ApiVersionTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ApiVersionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,19 +34,19 @@ class ApiVersionTests { @Test void parseWhenVersionIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ApiVersion.parse(null)) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test void parseWhenVersionIsEmptyThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ApiVersion.parse("")) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test void parseWhenVersionDoesNotMatchPatternThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ApiVersion.parse("bad")) - .withMessage("Malformed version number 'bad'"); + .withMessage("'value' [bad] must contain a well formed version number"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/BindingTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/BindingTests.java index 7f8d29c269f..ebd7e1c3de0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/BindingTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/BindingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ class BindingTests { @Test void ofWithNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> Binding.of(null)) - .withMessageContaining("Value must not be null"); + .withMessageContaining("'value' must not be null"); } @Test @@ -53,13 +53,13 @@ class BindingTests { @Test void fromWithNullSourceThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> Binding.from((String) null, "container-dest")) - .withMessageContaining("Source must not be null"); + .withMessageContaining("'source' must not be null"); } @Test void fromWithNullDestinationThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> Binding.from("host-src", null)) - .withMessageContaining("Destination must not be null"); + .withMessageContaining("'destination' must not be null"); } @Test @@ -71,7 +71,7 @@ class BindingTests { @Test void fromVolumeNameSourceWithNullSourceThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> Binding.from((VolumeName) null, "container-dest")) - .withMessageContaining("SourceVolume must not be null"); + .withMessageContaining("'sourceVolume' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerConfigTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerConfigTests.java index ce174809f0a..c59f7092620 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerConfigTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,14 +39,14 @@ class ContainerConfigTests extends AbstractJsonTests { @Test void ofWhenImageReferenceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ContainerConfig.of(null, (update) -> { - })).withMessage("ImageReference must not be null"); + })).withMessage("'imageReference' must not be null"); } @Test void ofWhenUpdateIsNullThrowsException() { ImageReference imageReference = ImageReference.of("ubuntu:bionic"); assertThatIllegalArgumentException().isThrownBy(() -> ContainerConfig.of(imageReference, null)) - .withMessage("Update must not be null"); + .withMessage("'update' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerContentTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerContentTests.java index e6027da5924..285ec9b7e14 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerContentTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerContentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,21 +34,21 @@ class ContainerContentTests { @Test void ofWhenArchiveIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ContainerContent.of(null)) - .withMessage("Archive must not be null"); + .withMessage("'archive' must not be null"); } @Test void ofWhenDestinationPathIsNullThrowsException() { TarArchive archive = mock(TarArchive.class); assertThatIllegalArgumentException().isThrownBy(() -> ContainerContent.of(archive, null)) - .withMessage("DestinationPath must not be empty"); + .withMessage("'destinationPath' must not be empty"); } @Test void ofWhenDestinationPathIsEmptyThrowsException() { TarArchive archive = mock(TarArchive.class); assertThatIllegalArgumentException().isThrownBy(() -> ContainerContent.of(archive, "")) - .withMessage("DestinationPath must not be empty"); + .withMessage("'destinationPath' must not be empty"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerReferenceTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerReferenceTests.java index 41d47672348..e6aa88b6ede 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerReferenceTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ContainerReferenceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,13 +38,13 @@ class ContainerReferenceTests { @Test void ofWhenNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ContainerReference.of(null)) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test void ofWhenEmptyThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ContainerReference.of("")) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageNameTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageNameTests.java index 717d165d406..43c4aacc8d1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageNameTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageNameTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,25 +118,26 @@ class ImageNameTests { @Test void ofWhenNameIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of(null)) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test void ofWhenNameIsEmptyThrowsException() { - assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of("")).withMessage("Value must not be empty"); + assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of("")) + .withMessage("'value' must not be empty"); } @Test void ofWhenContainsUppercaseThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of("Test")) - .withMessageContaining("Unable to parse name") + .withMessageContaining("must be a parsable name") .withMessageContaining("Test"); } @Test void ofWhenNameIncludesTagThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ImageName.of("ubuntu:latest")) - .withMessageContaining("Unable to parse name") + .withMessageContaining("must be a parsable name") .withMessageContaining(":latest"); } @@ -144,7 +145,7 @@ class ImageNameTests { void ofWhenNameIncludeDigestThrowsException() { assertThatIllegalArgumentException().isThrownBy( () -> ImageName.of("ubuntu@sha256:47bfdb88c3ae13e488167607973b7688f69d9e8c142c2045af343ec199649c09")) - .withMessageContaining("Unable to parse name") + .withMessageContaining("must be a parsable name") .withMessageContaining("@sha256:47b"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImagePlatformTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImagePlatformTests.java index 46da80ad239..b452f4cd95c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImagePlatformTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImagePlatformTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,13 +48,13 @@ class ImagePlatformTests extends AbstractJsonTests { @Test void ofWithEmptyValueFails() { assertThatIllegalArgumentException().isThrownBy(() -> ImagePlatform.of("")) - .withMessageContaining("Value must not be empty"); + .withMessageContaining("'value' must not be empty"); } @Test void ofWithTooManySegmentsFails() { assertThatIllegalArgumentException().isThrownBy(() -> ImagePlatform.of("linux/amd64/v1/extra")) - .withMessageContaining("value 'linux/amd64/v1/extra'"); + .withMessageContaining("'value' [linux/amd64/v1/extra] must be in the form"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageReferenceTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageReferenceTests.java index b22c27e1ba2..04e7b92f2d1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageReferenceTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageReferenceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -189,7 +189,7 @@ class ImageReferenceTests { assertThatIllegalArgumentException() .isThrownBy(() -> ImageReference .of("registry.example.com/example/example-app:1.6.0-dev.2.uncommitted+wip.foo.c75795d")) - .withMessageContaining("Unable to parse image reference"); + .withMessageContaining("must be an image reference"); } @Test @@ -197,7 +197,7 @@ class ImageReferenceTests { assertThatIllegalArgumentException() .isThrownBy(() -> ImageReference .of("europe-west1-docker.pkg.dev/aaaaaa-bbbbb-123456/docker-registry/bootBuildImage:0.0.1")) - .withMessageContaining("Unable to parse image reference"); + .withMessageContaining("must be an image reference"); } @Test @@ -205,7 +205,7 @@ class ImageReferenceTests { void ofWhenIsVeryLongAndHasIllegalCharacter() { assertThatIllegalArgumentException().isThrownBy(() -> ImageReference .of("docker.io/library/this-image-has-a-long-name-with-an-invalid-tag-which-is-at-danger-of-catastrophic-backtracking:1.0.0+1234")) - .withMessageContaining("Unable to parse image reference"); + .withMessageContaining("must be an image reference"); } @Test @@ -248,7 +248,7 @@ class ImageReferenceTests { @Test void randomWherePrefixIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> ImageReference.random(null)) - .withMessage("Prefix must not be null"); + .withMessage("'prefix' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerIdTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerIdTests.java index d910d0f8f93..3317665b893 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerIdTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerIdTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,12 +52,12 @@ class LayerIdTests { @Test void ofWhenValueIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> LayerId.of((String) null)) - .withMessage("Value must not be empty"); + .withMessage("'value' must not be empty"); } @Test void ofWhenValueIsEmptyThrowsException() { - assertThatIllegalArgumentException().isThrownBy(() -> LayerId.of(" ")).withMessage("Value must not be empty"); + assertThatIllegalArgumentException().isThrownBy(() -> LayerId.of(" ")).withMessage("'value' must not be empty"); } @Test @@ -80,13 +80,13 @@ class LayerIdTests { @Test void ofSha256DigestWhenNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> LayerId.ofSha256Digest((byte[]) null)) - .withMessage("Digest must not be null"); + .withMessage("'digest' must not be null"); } @Test void ofSha256DigestWhenWrongLengthThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> LayerId.ofSha256Digest(new byte[31])) - .withMessage("Digest must be exactly 32 bytes"); + .withMessage("'digest' must be exactly 32 bytes"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerTests.java index bad2124fb8d..1d46b6fedff 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,13 +40,13 @@ class LayerTests { @Test void ofWhenLayoutIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> Layer.of((IOConsumer) null)) - .withMessage("Layout must not be null"); + .withMessage("'layout' must not be null"); } @Test void fromTarArchiveWhenTarArchiveIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> Layer.fromTarArchive(null)) - .withMessage("TarArchive must not be null"); + .withMessage("'tarArchive' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/RandomStringTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/RandomStringTests.java index aa9284485d9..63d3c4e295c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/RandomStringTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/RandomStringTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ class RandomStringTests { @Test void generateWhenPrefixIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> RandomString.generate(null, 10)) - .withMessage("Prefix must not be null"); + .withMessage("'prefix' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/VolumeNameTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/VolumeNameTests.java index 90bafa796e5..45694928cc7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/VolumeNameTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/VolumeNameTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ class VolumeNameTests { @Test void randomWhenPrefixIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> VolumeName.random(null)) - .withMessage("Prefix must not be null"); + .withMessage("'prefix' must not be null"); } @Test @@ -57,25 +57,25 @@ class VolumeNameTests { @Test void basedOnWhenSourceIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> VolumeName.basedOn(null, "prefix", "suffix", 6)) - .withMessage("Source must not be null"); + .withMessage("'source' must not be null"); } @Test void basedOnWhenNameExtractorIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> VolumeName.basedOn("test", null, "prefix", "suffix", 6)) - .withMessage("NameExtractor must not be null"); + .withMessage("'nameExtractor' must not be null"); } @Test void basedOnWhenPrefixIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> VolumeName.basedOn("test", null, "suffix", 6)) - .withMessage("Prefix must not be null"); + .withMessage("'prefix' must not be null"); } @Test void basedOnWhenSuffixIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> VolumeName.basedOn("test", "prefix", null, 6)) - .withMessage("Suffix must not be null"); + .withMessage("'suffix' must not be null"); } @Test @@ -87,13 +87,13 @@ class VolumeNameTests { @Test void basedOnWhenSizeIsTooBigThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> VolumeName.basedOn("name", "prefix", "suffix", 33)) - .withMessage("DigestLength must be less than or equal to 32"); + .withMessage("'digestLength' must be less than or equal to 32"); } @Test void ofWhenValueIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> VolumeName.of(null)) - .withMessage("Value must not be null"); + .withMessage("'value' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ContentTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ContentTests.java index cb9a8eb1f20..bb2c5180d9d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ContentTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ContentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,9 +35,9 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException class ContentTests { @Test - void ofWhenStreamIsNullThrowsException() { + void ofWhenSupplierIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> Content.of(1, (IOSupplier) null)) - .withMessage("Supplier must not be null"); + .withMessage("'supplier' must not be null"); } @Test @@ -51,7 +51,7 @@ class ContentTests { @Test void ofWhenStringIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> Content.of((String) null)) - .withMessage("String must not be null"); + .withMessage("'string' must not be null"); } @Test @@ -63,7 +63,7 @@ class ContentTests { @Test void ofWhenBytesIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> Content.of((byte[]) null)) - .withMessage("Bytes must not be null"); + .withMessage("'bytes' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/InspectedContentTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/InspectedContentTests.java index dfbf2483ba0..f38ec190727 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/InspectedContentTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/InspectedContentTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,19 +39,19 @@ class InspectedContentTests { @Test void ofWhenInputStreamThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> InspectedContent.of((InputStream) null)) - .withMessage("InputStream must not be null"); + .withMessage("'inputStream' must not be null"); } @Test void ofWhenContentIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> InspectedContent.of((Content) null)) - .withMessage("Content must not be null"); + .withMessage("'content' must not be null"); } @Test void ofWhenConsumerIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> InspectedContent.of((IOConsumer) null)) - .withMessage("Writer must not be null"); + .withMessage("'writer' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java index 48c2f6f70e1..58b49b645f2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ class ZipFileTarArchiveTests { @Test void createWhenZipIsNullThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> new ZipFileTarArchive(null, Owner.ROOT)) - .withMessage("Zip must not be null"); + .withMessage("'zip' must not be null"); } @Test @@ -54,7 +54,7 @@ class ZipFileTarArchiveTests { File file = new File(this.tempDir, "test.zip"); writeTestZip(file); assertThatIllegalArgumentException().isThrownBy(() -> new ZipFileTarArchive(file, null)) - .withMessage("Owner must not be null"); + .withMessage("'owner' must not be null"); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java index 3360b402d9e..4a79dc08ec8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +72,7 @@ public class CommandRunner implements Iterable { * @param commands the commands to add */ public void addCommands(Iterable commands) { - Assert.notNull(commands, "Commands must not be null"); + Assert.notNull(commands, "'commands' must not be null"); for (Command command : commands) { addCommand(command); } @@ -83,7 +83,7 @@ public class CommandRunner implements Iterable { * @param command the command to add. */ public void addCommand(Command command) { - Assert.notNull(command, "Command must not be null"); + Assert.notNull(command, "'command' must not be null"); this.commands.add(command); } @@ -95,7 +95,7 @@ public class CommandRunner implements Iterable { * @see #isOptionCommand(Command) */ public void setOptionCommands(Class... commandClasses) { - Assert.notNull(commandClasses, "CommandClasses must not be null"); + Assert.notNull(commandClasses, "'commandClasses' must not be null"); this.optionCommandClasses = commandClasses; } @@ -105,7 +105,7 @@ public class CommandRunner implements Iterable { * @param commandClasses the classes of hidden commands */ public void setHiddenCommands(Class... commandClasses) { - Assert.notNull(commandClasses, "CommandClasses must not be null"); + Assert.notNull(commandClasses, "'commandClasses' must not be null"); this.hiddenCommandClasses = commandClasses; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java index a8d01cf1865..1d0dc3824f7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -482,7 +482,7 @@ class BootBuildImageIntegrationTests { writeLongNameResource(); BuildResult result = this.gradleBuild.buildAndFail("bootBuildImage", "--imageName=example/Invalid-Image-Name"); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.FAILED); - assertThat(result.getOutput()).containsPattern("Unable to parse image reference") + assertThat(result.getOutput()).containsPattern("must be an image reference") .containsPattern("example/Invalid-Image-Name"); } @@ -501,7 +501,7 @@ class BootBuildImageIntegrationTests { writeLongNameResource(); BuildResult result = this.gradleBuild.buildAndFail("bootBuildImage"); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.FAILED); - assertThat(result.getOutput()).containsPattern("Unable to parse image reference") + assertThat(result.getOutput()).containsPattern("must be an image reference") .containsPattern("example/Invalid-Tag-Name"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/FilterableDependency.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/FilterableDependency.java index 2d12921fa05..f95d895909e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/FilterableDependency.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/FilterableDependency.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,7 +79,7 @@ public abstract class FilterableDependency { public void set(String property) { String[] parts = property.split(":"); Assert.isTrue(parts.length == 2 || parts.length == 3, getClass().getSimpleName() - + " must be in the form groupId:artifactId or groupId:artifactId:classifier"); + + " 'property' must be in the form groupId:artifactId or groupId:artifactId:classifier"); setGroupId(parts[0]); setArtifactId(parts[1]); if (parts.length == 3) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java index db52cea7ff0..4e0004fff39 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,8 +81,8 @@ class BeanDefinitionLoader { * @param sources the bean sources */ BeanDefinitionLoader(BeanDefinitionRegistry registry, Object... sources) { - Assert.notNull(registry, "Registry must not be null"); - Assert.notEmpty(sources, "Sources must not be empty"); + Assert.notNull(registry, "'registry' must not be null"); + Assert.notEmpty(sources, "'sources' must not be empty"); this.sources = sources; this.annotatedReader = new AnnotatedBeanDefinitionReader(registry); this.xmlReader = new XmlBeanDefinitionReader(registry); @@ -131,7 +131,7 @@ class BeanDefinitionLoader { } private void load(Object source) { - Assert.notNull(source, "Source must not be null"); + Assert.notNull(source, "'source' must not be null"); if (source instanceof Class type) { load(type); return; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationArguments.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationArguments.java index 8298411e563..f84eaa92d3f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationArguments.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationArguments.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ public class DefaultApplicationArguments implements ApplicationArguments { private final String[] args; public DefaultApplicationArguments(String... args) { - Assert.notNull(args, "Args must not be null"); + Assert.notNull(args, "'args' must not be null"); this.source = new Source(args); this.args = args; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultBootstrapContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultBootstrapContext.java index eec1b2a714c..73301dec307 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultBootstrapContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultBootstrapContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,8 +52,8 @@ public class DefaultBootstrapContext implements ConfigurableBootstrapContext { } private void register(Class type, InstanceSupplier instanceSupplier, boolean replaceExisting) { - Assert.notNull(type, "Type must not be null"); - Assert.notNull(instanceSupplier, "InstanceSupplier must not be null"); + Assert.notNull(type, "'type' must not be null"); + Assert.notNull(instanceSupplier, "'instanceSupplier' must not be null"); synchronized (this.instanceSuppliers) { boolean alreadyRegistered = this.instanceSuppliers.containsKey(type); if (replaceExisting || !alreadyRegistered) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ExitCodeGenerators.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ExitCodeGenerators.java index 613143a09b6..edbccab0978 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ExitCodeGenerators.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ExitCodeGenerators.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,39 +42,39 @@ class ExitCodeGenerators implements Iterable { private final List generators = new ArrayList<>(); void addAll(Throwable exception, ExitCodeExceptionMapper... mappers) { - Assert.notNull(exception, "Exception must not be null"); - Assert.notNull(mappers, "Mappers must not be null"); + Assert.notNull(exception, "'exception' must not be null"); + Assert.notNull(mappers, "'mappers' must not be null"); addAll(exception, Arrays.asList(mappers)); } void addAll(Throwable exception, Iterable mappers) { - Assert.notNull(exception, "Exception must not be null"); - Assert.notNull(mappers, "Mappers must not be null"); + Assert.notNull(exception, "'exception' must not be null"); + Assert.notNull(mappers, "'mappers' must not be null"); for (ExitCodeExceptionMapper mapper : mappers) { add(exception, mapper); } } void add(Throwable exception, ExitCodeExceptionMapper mapper) { - Assert.notNull(exception, "Exception must not be null"); - Assert.notNull(mapper, "Mapper must not be null"); + Assert.notNull(exception, "'exception' must not be null"); + Assert.notNull(mapper, "'mapper' must not be null"); add(new MappedExitCodeGenerator(exception, mapper)); } void addAll(ExitCodeGenerator... generators) { - Assert.notNull(generators, "Generators must not be null"); + Assert.notNull(generators, "'generators' must not be null"); addAll(Arrays.asList(generators)); } void addAll(Iterable generators) { - Assert.notNull(generators, "Generators must not be null"); + Assert.notNull(generators, "'generators' must not be null"); for (ExitCodeGenerator generator : generators) { add(generator); } } void add(ExitCodeGenerator generator) { - Assert.notNull(generator, "Generator must not be null"); + Assert.notNull(generator, "'generator' must not be null"); this.generators.add(generator); AnnotationAwareOrderComparator.sort(this.generators); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java index 99e79a4af4f..4e38a508b62 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,8 +57,8 @@ public class ResourceBanner implements Banner { private final Resource resource; public ResourceBanner(Resource resource) { - Assert.notNull(resource, "Resource must not be null"); - Assert.isTrue(resource.exists(), "Resource must exist"); + Assert.notNull(resource, "'resource' must not be null"); + Assert.isTrue(resource.exists(), "'resource' must exist"); this.resource = resource; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index 4a673a37821..9fff7198ca9 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -270,7 +270,7 @@ public class SpringApplication { @SuppressWarnings({ "unchecked", "rawtypes" }) public SpringApplication(ResourceLoader resourceLoader, Class... primarySources) { this.resourceLoader = resourceLoader; - Assert.notNull(primarySources, "PrimarySources must not be null"); + Assert.notNull(primarySources, "'primarySources' must not be null"); this.primarySources = new LinkedHashSet<>(Arrays.asList(primarySources)); this.properties.setWebApplicationType(WebApplicationType.deduceFromClasspath()); this.bootstrapRegistryInitializers = new ArrayList<>( @@ -959,7 +959,7 @@ public class SpringApplication { * @since 2.0.0 */ public void setWebApplicationType(WebApplicationType webApplicationType) { - Assert.notNull(webApplicationType, "WebApplicationType must not be null"); + Assert.notNull(webApplicationType, "'webApplicationType' must not be null"); this.properties.setWebApplicationType(webApplicationType); } @@ -1068,7 +1068,7 @@ public class SpringApplication { * @since 2.4.5 */ public void addBootstrapRegistryInitializer(BootstrapRegistryInitializer bootstrapRegistryInitializer) { - Assert.notNull(bootstrapRegistryInitializer, "BootstrapRegistryInitializer must not be null"); + Assert.notNull(bootstrapRegistryInitializer, "'bootstrapRegistryInitializer' must not be null"); this.bootstrapRegistryInitializers.addAll(Arrays.asList(bootstrapRegistryInitializer)); } @@ -1169,7 +1169,7 @@ public class SpringApplication { * @see #getAllSources() */ public void setSources(Set sources) { - Assert.notNull(sources, "Sources must not be null"); + Assert.notNull(sources, "'sources' must not be null"); this.properties.setSources(sources); } @@ -1196,7 +1196,7 @@ public class SpringApplication { * @param resourceLoader the resource loader */ public void setResourceLoader(ResourceLoader resourceLoader) { - Assert.notNull(resourceLoader, "ResourceLoader must not be null"); + Assert.notNull(resourceLoader, "'resourceLoader' must not be null"); this.resourceLoader = resourceLoader; } @@ -1390,7 +1390,7 @@ public class SpringApplication { * @return the outcome (0 if successful) */ public static int exit(ApplicationContext context, ExitCodeGenerator... exitCodeGenerators) { - Assert.notNull(context, "Context must not be null"); + Assert.notNull(context, "'context' must not be null"); int exitCode = 0; try { try { @@ -1426,7 +1426,7 @@ public class SpringApplication { * @see #withHook(SpringApplicationHook, Runnable) */ public static SpringApplication.Augmented from(ThrowingConsumer main) { - Assert.notNull(main, "Main must not be null"); + Assert.notNull(main, "'main' must not be null"); return new Augmented(main, Collections.emptySet(), Collections.emptySet()); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java index 433087a1bed..1347bb80f9f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -177,7 +177,7 @@ class SpringApplicationShutdownHook implements Runnable { @Override public void add(Runnable action) { - Assert.notNull(action, "Action must not be null"); + Assert.notNull(action, "'action' must not be null"); addRuntimeShutdownHookIfNecessary(); synchronized (SpringApplicationShutdownHook.class) { assertNotInProgress(); @@ -187,7 +187,7 @@ class SpringApplicationShutdownHook implements Runnable { @Override public void remove(Runnable action) { - Assert.notNull(action, "Action must not be null"); + Assert.notNull(action, "'action' must not be null"); synchronized (SpringApplicationShutdownHook.class) { assertNotInProgress(); this.actions.remove(new Handler(action)); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java index b3d40bd8085..35bb085afe3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ class StartupInfoLogger { } void logStarting(Log applicationLog) { - Assert.notNull(applicationLog, "Log must not be null"); + Assert.notNull(applicationLog, "'applicationLog' must not be null"); applicationLog.info(LogMessage.of(this::getStartingMessage)); applicationLog.debug(LogMessage.of(this::getRunningMessage)); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java index 71ebfd98353..ac7f33a84f9 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +72,7 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { Assert.state(applicationContext instanceof ConfigurableApplicationContext, - "ApplicationContext does not implement ConfigurableApplicationContext"); + "'applicationContext' must be a ConfigurableApplicationContext"); this.applicationContext = (ConfigurableApplicationContext) applicationContext; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/Ansi8BitColor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/Ansi8BitColor.java index 2b926383f80..50e30b7cab0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/Ansi8BitColor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/Ansi8BitColor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ public final class Ansi8BitColor implements AnsiElement { * @throws IllegalArgumentException if color code is not between 0 and 255. */ private Ansi8BitColor(String prefix, int code) { - Assert.isTrue(code >= 0 && code <= 255, "Code must be between 0 and 255"); + Assert.isTrue(code >= 0 && code <= 255, "'code' must be between 0 and 255"); this.prefix = prefix; this.code = code; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiOutput.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiOutput.java index b0c815168f4..96a30333529 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiOutput.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiOutput.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ public abstract class AnsiOutput { * @param enabled if ANSI is enabled, disabled or detected */ public static void setEnabled(Enabled enabled) { - Assert.notNull(enabled, "Enabled must not be null"); + Assert.notNull(enabled, "'enabled' must not be null"); AnsiOutput.enabled = enabled; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/availability/ApplicationAvailabilityBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/availability/ApplicationAvailabilityBean.java index e88e18ea005..53f1f2c93a6 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/availability/ApplicationAvailabilityBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/availability/ApplicationAvailabilityBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,8 +52,8 @@ public class ApplicationAvailabilityBean @Override public S getState(Class stateType, S defaultState) { - Assert.notNull(stateType, "StateType must not be null"); - Assert.notNull(defaultState, "DefaultState must not be null"); + Assert.notNull(stateType, "'stateType' must not be null"); + Assert.notNull(defaultState, "'defaultState' must not be null"); S state = getState(stateType); return (state != null) ? state : defaultState; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/availability/AvailabilityChangeEvent.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/availability/AvailabilityChangeEvent.java index 19250603a29..49a41678463 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/availability/AvailabilityChangeEvent.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/availability/AvailabilityChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,7 +74,7 @@ public class AvailabilityChangeEvent extends Payloa * @param state the changed availability state */ public static void publish(ApplicationContext context, S state) { - Assert.notNull(context, "Context must not be null"); + Assert.notNull(context, "'context' must not be null"); publish(context, context, state); } @@ -88,7 +88,7 @@ public class AvailabilityChangeEvent extends Payloa */ public static void publish(ApplicationEventPublisher publisher, Object source, S state) { - Assert.notNull(publisher, "Publisher must not be null"); + Assert.notNull(publisher, "'publisher' must not be null"); publisher.publishEvent(new AvailabilityChangeEvent<>(source, state)); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ApplicationPidFileWriter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ApplicationPidFileWriter.java index 235027a9ecc..5e5267b4219 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ApplicationPidFileWriter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ApplicationPidFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,7 +115,7 @@ public class ApplicationPidFileWriter implements ApplicationListener triggerEventType) { - Assert.notNull(triggerEventType, "Trigger event type must not be null"); + Assert.notNull(triggerEventType, "'triggerEventType' must not be null"); this.triggerEventType = triggerEventType; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java index 744c04d3f4a..40fccce0d33 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,7 +73,7 @@ public abstract class Configurations { * @param classes the configuration classes */ protected Configurations(Collection> classes) { - Assert.notNull(classes, "Classes must not be null"); + Assert.notNull(classes, "'classes' must not be null"); Collection> sorted = sort(classes); this.sorter = null; this.classes = Collections.unmodifiableSet(new LinkedHashSet<>(sorted)); @@ -89,7 +89,7 @@ public abstract class Configurations { */ protected Configurations(UnaryOperator>> sorter, Collection> classes, Function, String> beanNameGenerator) { - Assert.notNull(classes, "Classes must not be null"); + Assert.notNull(classes, "'classes' must not be null"); this.sorter = (sorter != null) ? sorter : UnaryOperator.identity(); Collection> sorted = this.sorter.apply(classes); this.classes = Collections.unmodifiableSet(new LinkedHashSet<>(sorted)); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java index 9482c48afe1..31dde9c83ea 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,8 +72,8 @@ public final class ConfigData { */ public ConfigData(Collection> propertySources, PropertySourceOptions propertySourceOptions) { - Assert.notNull(propertySources, "PropertySources must not be null"); - Assert.notNull(propertySourceOptions, "PropertySourceOptions must not be null"); + Assert.notNull(propertySources, "'propertySources' must not be null"); + Assert.notNull(propertySourceOptions, "'propertySourceOptions' must not be null"); this.propertySources = Collections.unmodifiableList(new ArrayList<>(propertySources)); this.propertySourceOptions = propertySourceOptions; } @@ -250,7 +250,7 @@ public final class ConfigData { * @return a new {@link Options} instance */ public static Options of(Option... options) { - Assert.notNull(options, "Options must not be null"); + Assert.notNull(options, "'options' must not be null"); if (options.length == 0) { return NONE; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocationNotFoundException.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocationNotFoundException.java index 62bd68dc528..33f21c68caf 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocationNotFoundException.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocationNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ public class ConfigDataLocationNotFoundException extends ConfigDataNotFoundExcep */ public ConfigDataLocationNotFoundException(ConfigDataLocation location, String message, Throwable cause) { super(message, cause); - Assert.notNull(location, "Location must not be null"); + Assert.notNull(location, "'location' must not be null"); this.location = location; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundException.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundException.java index 0b7d8990a4b..439a0231d1b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundException.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ public class ConfigDataResourceNotFoundException extends ConfigDataNotFoundExcep private ConfigDataResourceNotFoundException(ConfigDataResource resource, ConfigDataLocation location, Throwable cause) { super(getMessage(resource, location), cause); - Assert.notNull(resource, "Resource must not be null"); + Assert.notNull(resource, "'resource' must not be null"); this.resource = resource; this.location = location; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigTreeConfigDataResource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigTreeConfigDataResource.java index b0977f9c085..f842d1cedfd 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigTreeConfigDataResource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigTreeConfigDataResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,12 +36,12 @@ public class ConfigTreeConfigDataResource extends ConfigDataResource { private final Path path; ConfigTreeConfigDataResource(String path) { - Assert.notNull(path, "Path must not be null"); + Assert.notNull(path, "'path' must not be null"); this.path = Paths.get(path).toAbsolutePath(); } ConfigTreeConfigDataResource(Path path) { - Assert.notNull(path, "Path must not be null"); + Assert.notNull(path, "'path' must not be null"); this.path = path.toAbsolutePath(); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataResource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataResource.java index aac0897413e..f85e56eccc7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataResource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,8 +56,8 @@ public class StandardConfigDataResource extends ConfigDataResource { * @param emptyDirectory if the resource is an empty directory that we know exists */ StandardConfigDataResource(StandardConfigDataReference reference, Resource resource, boolean emptyDirectory) { - Assert.notNull(reference, "Reference must not be null"); - Assert.notNull(resource, "Resource must not be null"); + Assert.notNull(reference, "'reference' must not be null"); + Assert.notNull(resource, "'resource' must not be null"); this.reference = reference; this.resource = resource; this.emptyDirectory = emptyDirectory; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/BoundConfigurationProperties.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/BoundConfigurationProperties.java index 416c7766483..16d29352c22 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/BoundConfigurationProperties.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/BoundConfigurationProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ public class BoundConfigurationProperties { } static void register(BeanDefinitionRegistry registry) { - Assert.notNull(registry, "Registry must not be null"); + Assert.notNull(registry, "'registry' must not be null"); if (!registry.containsBeanDefinition(BEAN_NAME)) { BeanDefinition definition = BeanDefinitionBuilder.rootBeanDefinition(BoundConfigurationProperties.class) .setRole(BeanDefinition.ROLE_INFRASTRUCTURE) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBean.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBean.java index 35a7a71552b..e0f1118e2df 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBean.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -128,7 +128,7 @@ public final class ConfigurationPropertiesBean { * @return a map of all configuration properties beans keyed by the bean name */ public static Map getAll(ApplicationContext applicationContext) { - Assert.notNull(applicationContext, "ApplicationContext must not be null"); + Assert.notNull(applicationContext, "'applicationContext' must not be null"); if (applicationContext instanceof ConfigurableApplicationContext configurableContext) { return getAll(configurableContext); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java index c80c0526e52..34177a1c581 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,7 +107,7 @@ public class ConfigurationPropertiesBindingPostProcessor * @since 2.2.0 */ public static void register(BeanDefinitionRegistry registry) { - Assert.notNull(registry, "Registry must not be null"); + Assert.notNull(registry, "'registry' must not be null"); if (!registry.containsBeanDefinition(BEAN_NAME)) { BeanDefinition definition = BeanDefinitionBuilder .rootBeanDefinition(ConfigurationPropertiesBindingPostProcessor.class) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java index 87c03f77d3a..9c571539443 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,7 @@ public final class PropertyMapper { * @return a new property mapper instance */ public PropertyMapper alwaysApplying(SourceOperator operator) { - Assert.notNull(operator, "Operator must not be null"); + Assert.notNull(operator, "'operator' must not be null"); return new PropertyMapper(this, operator); } @@ -104,7 +104,7 @@ public final class PropertyMapper { * @see #from(Object) */ public Source from(Supplier supplier) { - Assert.notNull(supplier, "Supplier must not be null"); + Assert.notNull(supplier, "'supplier' must not be null"); Source source = getSource(supplier); if (this.sourceOperator != null) { source = this.sourceOperator.apply(source); @@ -167,7 +167,7 @@ public final class PropertyMapper { private final Predicate predicate; private Source(Supplier supplier, Predicate predicate) { - Assert.notNull(predicate, "Predicate must not be null"); + Assert.notNull(predicate, "'predicate' must not be null"); this.supplier = supplier; this.predicate = predicate; } @@ -190,7 +190,7 @@ public final class PropertyMapper { * @return a new adapted source instance */ public Source as(Function adapter) { - Assert.notNull(adapter, "Adapter must not be null"); + Assert.notNull(adapter, "'adapter' must not be null"); Supplier test = () -> this.predicate.test(this.supplier.get()); Predicate predicate = (t) -> test.get(); Supplier supplier = () -> { @@ -266,7 +266,7 @@ public final class PropertyMapper { * @return a new filtered source instance */ public Source whenNot(Predicate predicate) { - Assert.notNull(predicate, "Predicate must not be null"); + Assert.notNull(predicate, "'predicate' must not be null"); return when(predicate.negate()); } @@ -277,7 +277,7 @@ public final class PropertyMapper { * @return a new filtered source instance */ public Source when(Predicate predicate) { - Assert.notNull(predicate, "Predicate must not be null"); + Assert.notNull(predicate, "'predicate' must not be null"); return new Source<>(this.supplier, (this.predicate != null) ? this.predicate.and(predicate) : predicate); } @@ -288,7 +288,7 @@ public final class PropertyMapper { * filtered */ public void to(Consumer consumer) { - Assert.notNull(consumer, "Consumer must not be null"); + Assert.notNull(consumer, "'consumer' must not be null"); T value = this.supplier.get(); if (this.predicate.test(value)) { consumer.accept(value); @@ -307,8 +307,8 @@ public final class PropertyMapper { * @since 3.0.0 */ public R to(R instance, BiFunction mapper) { - Assert.notNull(instance, "Instance must not be null"); - Assert.notNull(mapper, "Mapper must not be null"); + Assert.notNull(instance, "'instance' must not be null"); + Assert.notNull(mapper, "'mapper' must not be null"); T value = this.supplier.get(); return (!this.predicate.test(value)) ? instance : mapper.apply(instance, value); } @@ -321,7 +321,7 @@ public final class PropertyMapper { * @throws NoSuchElementException if the value has been filtered */ public R toInstance(Function factory) { - Assert.notNull(factory, "Factory must not be null"); + Assert.notNull(factory, "'factory' must not be null"); T value = this.supplier.get(); if (!this.predicate.test(value)) { throw new NoSuchElementException("No value present"); @@ -335,7 +335,7 @@ public final class PropertyMapper { * @param runnable the method to call if the value has not been filtered */ public void toCall(Runnable runnable) { - Assert.notNull(runnable, "Runnable must not be null"); + Assert.notNull(runnable, "'runnable' must not be null"); T value = this.supplier.get(); if (this.predicate.test(value)) { runnable.run(); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AbstractBindHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AbstractBindHandler.java index 7c0fd742fd8..a0d102ff098 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AbstractBindHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AbstractBindHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ public abstract class AbstractBindHandler implements BindHandler { * @param parent the parent handler */ public AbstractBindHandler(BindHandler parent) { - Assert.notNull(parent, "Parent must not be null"); + Assert.notNull(parent, "'parent' must not be null"); this.parent = parent; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java index 2cc12866590..d33010d7988 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +71,7 @@ public final class BindResult { * @param consumer block to execute if a value has been bound */ public void ifBound(Consumer consumer) { - Assert.notNull(consumer, "Consumer must not be null"); + Assert.notNull(consumer, "'consumer' must not be null"); if (this.value != null) { consumer.accept(this.value); } @@ -87,7 +87,7 @@ public final class BindResult { * to the value of this {@code BindResult}. */ public BindResult map(Function mapper) { - Assert.notNull(mapper, "Mapper must not be null"); + Assert.notNull(mapper, "'mapper' must not be null"); return of((this.value != null) ? mapper.apply(this.value) : null); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java index 9e76a84e82c..6b5d6f558e2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -192,7 +192,7 @@ public final class Bindable { public Bindable withExistingValue(T existingValue) { Assert.isTrue( existingValue == null || this.type.isArray() || this.boxedType.resolve().isInstance(existingValue), - () -> "ExistingValue must be an instance of " + this.type); + () -> "'existingValue' must be an instance of " + this.type); Assert.state(this.bindMethod != BindMethod.VALUE_OBJECT, () -> "An existing value cannot be provided when binding as a value object"); Supplier value = (existingValue != null) ? () -> existingValue : null; @@ -249,7 +249,7 @@ public final class Bindable { */ @SuppressWarnings("unchecked") public static Bindable ofInstance(T instance) { - Assert.notNull(instance, "Instance must not be null"); + Assert.notNull(instance, "'instance' must not be null"); Class type = (Class) instance.getClass(); return of(type).withExistingValue(instance); } @@ -262,7 +262,7 @@ public final class Bindable { * @see #of(ResolvableType) */ public static Bindable of(Class type) { - Assert.notNull(type, "Type must not be null"); + Assert.notNull(type, "'type' must not be null"); return of(ResolvableType.forClass(type)); } @@ -306,7 +306,7 @@ public final class Bindable { * @see #of(Class) */ public static Bindable of(ResolvableType type) { - Assert.notNull(type, "Type must not be null"); + Assert.notNull(type, "'type' must not be null"); ResolvableType boxedType = box(type); return new Bindable<>(type, boxedType, null, NO_ANNOTATIONS, NO_BIND_RESTRICTIONS, null); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java index 6f70266024a..bb423228222 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,7 +108,7 @@ public class BindableRuntimeHintsRegistrar implements RuntimeHintsRegistrar { * @return a new {@link BindableRuntimeHintsRegistrar} instance */ public static BindableRuntimeHintsRegistrar forTypes(Iterable> types) { - Assert.notNull(types, "Types must not be null"); + Assert.notNull(types, "'types' must not be null"); return forTypes(StreamSupport.stream(types.spliterator(), false).toArray(Class[]::new)); } @@ -128,7 +128,7 @@ public class BindableRuntimeHintsRegistrar implements RuntimeHintsRegistrar { * @since 3.0.8 */ public static BindableRuntimeHintsRegistrar forBindables(Iterable> bindables) { - Assert.notNull(bindables, "Bindables must not be null"); + Assert.notNull(bindables, "'bindables' must not be null"); return forBindables(StreamSupport.stream(bindables.spliterator(), false).toArray(Bindable[]::new)); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java index 1630d2d8997..a4d7e253719 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,9 +184,9 @@ public class Binder { public Binder(Iterable sources, PlaceholdersResolver placeholdersResolver, List conversionServices, Consumer propertyEditorInitializer, BindHandler defaultBindHandler, BindConstructorProvider constructorProvider) { - Assert.notNull(sources, "Sources must not be null"); + Assert.notNull(sources, "'sources' must not be null"); for (ConfigurationPropertySource source : sources) { - Assert.notNull(source, "Sources must not contain null elements"); + Assert.notNull(source, "'sources' must not contain null elements"); } this.sources = sources; this.placeholdersResolver = (placeholdersResolver != null) ? placeholdersResolver : PlaceholdersResolver.NONE; @@ -332,8 +332,8 @@ public class Binder { } private T bind(ConfigurationPropertyName name, Bindable target, BindHandler handler, boolean create) { - Assert.notNull(name, "Name must not be null"); - Assert.notNull(target, "Target must not be null"); + Assert.notNull(name, "'name' must not be null"); + Assert.notNull(target, "'target' must not be null"); handler = (handler != null) ? handler : this.defaultBindHandler; Context context = new Context(); return bind(name, target, handler, context, false, create); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BoundPropertiesTrackingBindHandler.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BoundPropertiesTrackingBindHandler.java index f2a136be1d8..1b86b34d0ba 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BoundPropertiesTrackingBindHandler.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BoundPropertiesTrackingBindHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ public class BoundPropertiesTrackingBindHandler extends AbstractBindHandler { private final Consumer consumer; public BoundPropertiesTrackingBindHandler(Consumer consumer) { - Assert.notNull(consumer, "Consumer must not be null"); + Assert.notNull(consumer, "'consumer' must not be null"); this.consumer = consumer; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/PropertySourcesPlaceholdersResolver.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/PropertySourcesPlaceholdersResolver.java index 67e432fab52..7bf6807ef3d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/PropertySourcesPlaceholdersResolver.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/PropertySourcesPlaceholdersResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,9 +74,9 @@ public class PropertySourcesPlaceholdersResolver implements PlaceholdersResolver } private static PropertySources getSources(Environment environment) { - Assert.notNull(environment, "Environment must not be null"); + Assert.notNull(environment, "'environment' must not be null"); Assert.isInstanceOf(ConfigurableEnvironment.class, environment, - "Environment must be a ConfigurableEnvironment"); + "'environment' must be a ConfigurableEnvironment"); return ((ConfigurableEnvironment) environment).getPropertySources(); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/BindValidationException.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/BindValidationException.java index b1be6d24c85..d674cc08c25 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/BindValidationException.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/BindValidationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ public class BindValidationException extends RuntimeException { BindValidationException(ValidationErrors validationErrors) { super(getMessage(validationErrors)); - Assert.notNull(validationErrors, "ValidationErrors must not be null"); + Assert.notNull(validationErrors, "'validationErrors' must not be null"); this.validationErrors = validationErrors; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationErrors.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationErrors.java index 1dd1d578465..390894989fb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationErrors.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationErrors.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,9 +49,9 @@ public class ValidationErrors implements Iterable { ValidationErrors(ConfigurationPropertyName name, Set boundProperties, List errors) { - Assert.notNull(name, "Name must not be null"); - Assert.notNull(boundProperties, "BoundProperties must not be null"); - Assert.notNull(errors, "Errors must not be null"); + Assert.notNull(name, "'name' must not be null"); + Assert.notNull(boundProperties, "'boundProperties' must not be null"); + Assert.notNull(errors, "'errors' must not be null"); this.name = name; this.boundProperties = Collections.unmodifiableSet(boundProperties); this.errors = convertErrors(name, boundProperties, errors); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/AliasedConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/AliasedConfigurationPropertySource.java index 6c48ed3b43f..33e89baab2c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/AliasedConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/AliasedConfigurationPropertySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,15 +31,15 @@ class AliasedConfigurationPropertySource implements ConfigurationPropertySource private final ConfigurationPropertyNameAliases aliases; AliasedConfigurationPropertySource(ConfigurationPropertySource source, ConfigurationPropertyNameAliases aliases) { - Assert.notNull(source, "Source must not be null"); - Assert.notNull(aliases, "Aliases must not be null"); + Assert.notNull(source, "'source' must not be null"); + Assert.notNull(aliases, "'aliases' must not be null"); this.source = source; this.aliases = aliases; } @Override public ConfigurationProperty getConfigurationProperty(ConfigurationPropertyName name) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); ConfigurationProperty result = getSource().getConfigurationProperty(name); if (result == null) { ConfigurationPropertyName aliasedName = getAliases().getNameForAlias(name); @@ -50,7 +50,7 @@ class AliasedConfigurationPropertySource implements ConfigurationPropertySource @Override public ConfigurationPropertyState containsDescendantOf(ConfigurationPropertyName name) { - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); ConfigurationPropertyState result = this.source.containsDescendantOf(name); if (result != ConfigurationPropertyState.ABSENT) { return result; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationProperty.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationProperty.java index 27f4948e1a1..4fa1d275bef 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationProperty.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,8 +48,8 @@ public final class ConfigurationProperty implements OriginProvider, Comparable sources, Object underlyingSource) { - Assert.notNull(sources, "Sources must not be null"); + Assert.notNull(sources, "'sources' must not be null"); if (underlyingSource == null) { return new ConfigurationPropertySourcesCaching(sources); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliases.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliases.java index 5a077ad00a1..d44ab92475f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliases.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliases.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,15 +50,15 @@ public final class ConfigurationPropertyNameAliases implements Iterable ConfigurationPropertyState search(Iterable source, Predicate predicate) { - Assert.notNull(source, "Source must not be null"); - Assert.notNull(predicate, "Predicate must not be null"); + Assert.notNull(source, "'source' must not be null"); + Assert.notNull(predicate, "'predicate' must not be null"); for (T item : source) { if (predicate.test(item)) { return PRESENT; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/FilteredConfigurationPropertiesSource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/FilteredConfigurationPropertiesSource.java index 86a266f0133..92f72918f97 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/FilteredConfigurationPropertiesSource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/FilteredConfigurationPropertiesSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,8 +34,8 @@ class FilteredConfigurationPropertiesSource implements ConfigurationPropertySour FilteredConfigurationPropertiesSource(ConfigurationPropertySource source, Predicate filter) { - Assert.notNull(source, "Source must not be null"); - Assert.notNull(filter, "Filter must not be null"); + Assert.notNull(source, "'source' must not be null"); + Assert.notNull(filter, "'filter' must not be null"); this.source = source; this.filter = filter; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/InvalidConfigurationPropertyValueException.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/InvalidConfigurationPropertyValueException.java index 1bef986b34e..60470e3798a 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/InvalidConfigurationPropertyValueException.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/InvalidConfigurationPropertyValueException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public class InvalidConfigurationPropertyValueException extends RuntimeException InvalidConfigurationPropertyValueException(String name, Object value, String reason, Throwable cause) { super("Property " + name + " with value '" + value + "' is invalid: " + reason, cause); - Assert.notNull(name, "Name must not be null"); + Assert.notNull(name, "'name' must not be null"); this.name = name; this.value = value; this.reason = reason; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java index b24f13fa94f..ae7e1c89e09 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,7 +65,7 @@ public class MapConfigurationPropertySource implements IterableConfigurationProp * @param map the source map */ public void putAll(Map map) { - Assert.notNull(map, "Map must not be null"); + Assert.notNull(map, "'map' must not be null"); assertNotReadOnlySystemAttributesMap(map); map.forEach(this::put); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MutuallyExclusiveConfigurationPropertiesException.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MutuallyExclusiveConfigurationPropertiesException.java index b0fa0a3e816..cc868e6759b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MutuallyExclusiveConfigurationPropertiesException.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MutuallyExclusiveConfigurationPropertiesException.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,9 +84,9 @@ public class MutuallyExclusiveConfigurationPropertiesException extends RuntimeEx private static String buildMessage(Set mutuallyExclusiveNames, Set configuredNames) { Assert.isTrue(configuredNames != null && configuredNames.size() > 1, - "ConfiguredNames must contain 2 or more names"); + "'configuredNames' must contain 2 or more names"); Assert.isTrue(mutuallyExclusiveNames != null && mutuallyExclusiveNames.size() > 1, - "MutuallyExclusiveNames must contain 2 or more names"); + "'mutuallyExclusiveNames' must contain 2 or more names"); return "The configuration properties '" + String.join(", ", mutuallyExclusiveNames) + "' are mutually exclusive and '" + String.join(", ", configuredNames) + "' have been configured together"; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PrefixedConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PrefixedConfigurationPropertySource.java index 7e206625824..34192c1216e 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PrefixedConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PrefixedConfigurationPropertySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,8 +30,8 @@ class PrefixedConfigurationPropertySource implements ConfigurationPropertySource private final ConfigurationPropertyName prefix; PrefixedConfigurationPropertySource(ConfigurationPropertySource source, String prefix) { - Assert.notNull(source, "Source must not be null"); - Assert.hasText(prefix, "Prefix must not be empty"); + Assert.notNull(source, "'source' must not be null"); + Assert.hasText(prefix, "'prefix' must not be empty"); this.source = source; this.prefix = ConfigurationPropertyName.of(prefix); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java index 965b2ed14ab..c13d3c56b86 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,8 +67,8 @@ class SpringConfigurationPropertySource implements ConfigurationPropertySource { * @param mappers the property mappers */ SpringConfigurationPropertySource(PropertySource propertySource, PropertyMapper... mappers) { - Assert.notNull(propertySource, "PropertySource must not be null"); - Assert.isTrue(mappers.length > 0, "Mappers must contain at least one item"); + Assert.notNull(propertySource, "'propertySource' must not be null"); + Assert.isTrue(mappers.length > 0, "'mappers' must contain at least one item"); this.propertySource = propertySource; this.mappers = mappers; } @@ -144,7 +144,7 @@ class SpringConfigurationPropertySource implements ConfigurationPropertySource { * {@link SpringIterableConfigurationPropertySource} instance */ static SpringConfigurationPropertySource from(PropertySource source) { - Assert.notNull(source, "Source must not be null"); + Assert.notNull(source, "'source' must not be null"); PropertyMapper[] mappers = getPropertyMappers(source); if (isFullEnumerable(source)) { return new SpringIterableConfigurationPropertySource((EnumerablePropertySource) source, mappers); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySources.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySources.java index b3d608d935e..4fe4a5625f0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySources.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySources.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ class SpringConfigurationPropertySources implements Iterable> sources) { - Assert.notNull(sources, "Sources must not be null"); + Assert.notNull(sources, "'sources' must not be null"); this.sources = sources; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToArrayConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToArrayConverter.java index e2b4237924b..4ece3986fe8 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToArrayConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToArrayConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ final class DelimitedStringToArrayConverter implements ConditionalGenericConvert private final ConversionService conversionService; DelimitedStringToArrayConverter(ConversionService conversionService) { - Assert.notNull(conversionService, "ConversionService must not be null"); + Assert.notNull(conversionService, "'conversionService' must not be null"); this.conversionService = conversionService; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToCollectionConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToCollectionConverter.java index 7f5281a28f9..d9b1f2e29b3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToCollectionConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToCollectionConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ final class DelimitedStringToCollectionConverter implements ConditionalGenericCo private final ConversionService conversionService; DelimitedStringToCollectionConverter(ConversionService conversionService) { - Assert.notNull(conversionService, "ConversionService must not be null"); + Assert.notNull(conversionService, "'conversionService' must not be null"); this.conversionService = conversionService; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java index 61833f0c97c..46aabde4e88 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -162,7 +162,7 @@ public enum DurationStyle { * @throws IllegalArgumentException if the value is not a known style */ public static DurationStyle detect(String value) { - Assert.notNull(value, "Value must not be null"); + Assert.notNull(value, "'value' must not be null"); for (DurationStyle candidate : values()) { if (candidate.matches(value)) { return candidate; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java index cc5319c4ac1..820d7e360b1 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java @@ -204,7 +204,7 @@ public enum PeriodStyle { * @throws IllegalArgumentException if the value is not a known style */ public static PeriodStyle detect(String value) { - Assert.notNull(value, "Value must not be null"); + Assert.notNull(value, "'value' must not be null"); for (PeriodStyle candidate : values()) { if (candidate.matches(value)) { return candidate; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java index 521b275a098..37526035693 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/ConfigTreePropertySource.java @@ -105,8 +105,10 @@ public class ConfigTreePropertySource extends EnumerablePropertySource imp private ConfigTreePropertySource(String name, Path sourceDirectory, Set