From a49719d73eddf215ac53c12ed606563cdebb8e14 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 9 Jan 2025 15:33:44 -0800 Subject: [PATCH] Use consistent exception messages in Assert calls Update `Assert` calls to consistently use messages of the form "'item' must [not] ...". Closes gh-43780 --- ...vailabilityProbesHealthEndpointGroups.java | 4 +- ...AvailabilityProbesHealthEndpointGroup.java | 4 +- .../ReactiveCloudFoundrySecurityService.java | 6 +- .../servlet/CloudFoundrySecurityService.java | 6 +- .../expose/IncludeExcludeEndpointFilter.java | 14 ++--- .../endpoint/web/WebEndpointProperties.java | 4 +- ...mpositeHealthContributorConfiguration.java | 4 +- ...rceHealthContributorAutoConfiguration.java | 4 +- .../OnlyOnceLoggingDenyMeterFilter.java | 4 +- .../metrics/PropertiesMeterFilter.java | 4 +- .../properties/PropertiesConfigAdapter.java | 4 +- .../DiskSpaceHealthIndicatorProperties.java | 4 +- .../tracing/LocalBaggageFields.java | 4 +- .../autoconfigure/tracing/SpanExporters.java | 4 +- .../autoconfigure/tracing/SpanProcessors.java | 4 +- .../web/servlet/ManagementErrorEndpoint.java | 6 +- ...bilityProbesHealthEndpointGroupsTests.java | 4 +- .../IncludeExcludeEndpointFilterTests.java | 10 ++-- .../web/WebEndpointPropertiesTests.java | 4 +- ...teHealthContributorConfigurationTests.java | 4 +- .../metrics/PropertiesMeterFilterTests.java | 4 +- ...althContributorAutoConfigurationTests.java | 4 +- .../actuate/amqp/RabbitHealthIndicator.java | 4 +- .../boot/actuate/audit/AuditEvent.java | 6 +- .../actuate/audit/AuditEventsEndpoint.java | 4 +- .../audit/InMemoryAuditEventRepository.java | 4 +- .../audit/listener/AuditApplicationEvent.java | 4 +- .../AvailabilityStateHealthIndicator.java | 6 +- .../CassandraDriverHealthIndicator.java | 4 +- ...assandraDriverReactiveHealthIndicator.java | 4 +- .../couchbase/CouchbaseHealthIndicator.java | 4 +- .../mongo/MongoReactiveHealthIndicator.java | 4 +- .../data/redis/RedisHealthIndicator.java | 4 +- .../endpoint/AbstractExposableEndpoint.java | 6 +- .../boot/actuate/endpoint/Access.java | 4 +- .../boot/actuate/endpoint/EndpointId.java | 12 ++-- .../actuate/endpoint/InvocationContext.java | 6 +- .../endpoint/OperationArgumentResolver.java | 6 +- .../AbstractDiscoveredEndpoint.java | 6 +- .../annotation/DiscoveredOperationMethod.java | 4 +- .../annotation/DiscovererEndpointFilter.java | 4 +- .../annotation/EndpointDiscoverer.java | 16 +++--- ...ConversionServiceParameterValueMapper.java | 4 +- .../invoke/reflect/OperationMethod.java | 6 +- .../reflect/OperationMethodParameters.java | 6 +- .../reflect/ReflectiveOperationInvoker.java | 8 +-- .../cache/CachingOperationInvoker.java | 4 +- .../actuate/endpoint/jmx/EndpointMBean.java | 6 +- .../endpoint/jmx/JmxEndpointExporter.java | 10 ++-- .../endpoint/web/EndpointMediaTypes.java | 6 +- .../actuate/endpoint/web/EndpointServlet.java | 12 ++-- .../boot/actuate/endpoint/web/Link.java | 4 +- .../endpoint/web/PathMappedEndpoints.java | 6 +- .../boot/actuate/endpoint/web/PathMapper.java | 4 +- .../web/ServletEndpointRegistrar.java | 4 +- .../annotation/RequestPredicateFactory.java | 4 +- .../ControllerEndpointHandlerMapping.java | 6 +- .../ControllerEndpointHandlerMapping.java | 6 +- .../hazelcast/HazelcastHealthIndicator.java | 4 +- .../health/AbstractHealthIndicator.java | 4 +- .../AbstractReactiveHealthIndicator.java | 4 +- .../health/AdditionalHealthEndpointPath.java | 14 ++--- .../boot/actuate/health/CompositeHealth.java | 4 +- ...ositeHealthContributorReactiveAdapter.java | 4 +- .../health/DefaultContributorRegistry.java | 12 ++-- .../boot/actuate/health/Health.java | 26 ++++----- .../actuate/health/HealthEndpointGroups.java | 10 ++-- .../actuate/health/HealthEndpointSupport.java | 6 +- .../HealthIndicatorReactiveAdapter.java | 4 +- .../boot/actuate/health/NamedContributor.java | 6 +- .../health/NamedContributorsMapAdapter.java | 27 ++++----- .../health/ReactiveHealthContributor.java | 4 +- .../boot/actuate/health/Status.java | 6 +- .../boot/actuate/info/InfoEndpoint.java | 4 +- .../actuate/info/SimpleInfoContributor.java | 4 +- .../actuate/ldap/LdapHealthIndicator.java | 4 +- .../actuate/liquibase/LiquibaseEndpoint.java | 4 +- .../boot/actuate/logging/LoggersEndpoint.java | 10 ++-- .../actuate/metrics/amqp/RabbitMetrics.java | 4 +- .../PrometheusPushGatewayManager.java | 12 ++-- .../metrics/jdbc/DataSourcePoolMetrics.java | 6 +- .../system/DiskSpaceMetricsBinder.java | 4 +- .../ObservationRestClientCustomizer.java | 6 +- .../boot/actuate/quartz/QuartzEndpoint.java | 4 +- .../ConnectionFactoryHealthIndicator.java | 4 +- .../session/ReactiveSessionsEndpoint.java | 4 +- .../actuate/session/SessionsEndpoint.java | 4 +- .../web/exchanges/HttpExchangesEndpoint.java | 4 +- .../amqp/RabbitHealthIndicatorTests.java | 4 +- .../boot/actuate/audit/AuditEventTests.java | 6 +- .../InMemoryAuditEventRepositoryTests.java | 4 +- ...AvailabilityStateHealthIndicatorTests.java | 6 +- .../actuate/endpoint/EndpointIdTests.java | 17 +++--- .../endpoint/InvocationContextTests.java | 6 +- .../DiscoveredOperationMethodTests.java | 4 +- .../DiscovererEndpointFilterTests.java | 4 +- .../annotation/EndpointDiscovererTests.java | 10 ++-- .../OperationMethodParametersTests.java | 6 +- .../invoke/reflect/OperationMethodTests.java | 6 +- .../ReflectiveOperationInvokerTests.java | 8 +-- .../cache/CachingOperationInvokerTests.java | 4 +- .../endpoint/jmx/EndpointMBeanTests.java | 6 +- .../jmx/JmxEndpointExporterTests.java | 10 ++-- .../endpoint/web/EndpointMediaTypesTests.java | 6 +- .../endpoint/web/EndpointServletTests.java | 6 +- .../boot/actuate/endpoint/web/LinkTests.java | 4 +- .../web/PathMappedEndpointsTests.java | 6 +- .../web/ServletEndpointRegistrarTests.java | 4 +- ...HealthContributorReactiveAdapterTests.java | 4 +- .../actuate/health/CompositeHealthTests.java | 4 +- .../health/HealthEndpointGroupsTests.java | 6 +- .../health/HealthEndpointSupportTests.java | 6 +- .../boot/actuate/health/HealthTests.java | 4 +- .../actuate/health/NamedContributorTests.java | 6 +- .../NamedContributorsMapAdapterTests.java | 12 ++-- .../ReactiveHealthContributorTests.java | 4 +- .../boot/actuate/health/StatusTests.java | 6 +- .../PrometheusPushGatewayManagerTests.java | 12 ++-- .../AutoConfigurationSorter.java | 4 +- .../AbstractConnectionFactoryConfigurer.java | 8 +-- ...bitListenerContainerFactoryConfigurer.java | 8 +-- ...RabbitConnectionFactoryBeanConfigurer.java | 10 ++-- .../amqp/RabbitTemplateConfigurer.java | 4 +- .../batch/JobLauncherApplicationRunner.java | 6 +- .../autoconfigure/cache/CacheProperties.java | 4 +- .../condition/AbstractNestedCondition.java | 4 +- .../condition/ConditionEvaluationReport.java | 12 ++-- .../condition/ConditionMessage.java | 8 +-- .../condition/ConditionOutcome.java | 4 +- ...DatabaseFactoryDependentConfiguration.java | 6 +- .../data/redis/RedisConnectionDetails.java | 4 +- .../NoSuchBeanDefinitionFailureAnalyzer.java | 5 +- .../domain/EntityScanPackages.java | 10 ++-- .../autoconfigure/domain/EntityScanner.java | 4 +- .../flyway/FlywayMigrationInitializer.java | 4 +- .../autoconfigure/h2/H2ConsoleProperties.java | 8 +-- .../HazelcastConfigResourceCondition.java | 4 +- ...JmsListenerContainerFactoryConfigurer.java | 6 +- .../ActiveMQConnectionFactoryConfigurer.java | 4 +- .../ArtemisConnectionFactoryFactory.java | 8 +-- ...ultExceptionTranslatorExecuteListener.java | 4 +- .../autoconfigure/ldap/LdapProperties.java | 4 +- .../liquibase/LiquibaseProperties.java | 4 +- .../ConditionEvaluationReportLogger.java | 8 +-- ...ditionEvaluationReportLoggingListener.java | 14 ++--- .../orm/jpa/HibernateProperties.java | 6 +- .../pulsar/PulsarProperties.java | 12 ++-- .../OAuth2ResourceServerProperties.java | 8 ++- .../reactive/StaticResourceRequest.java | 6 +- .../servlet/StaticResourceRequest.java | 6 +- .../autoconfigure/ssl/CertificateMatcher.java | 2 +- .../boot/autoconfigure/ssl/FileWatcher.java | 8 +-- .../TemplateAvailabilityProviders.java | 16 +++--- .../template/TemplateLocation.java | 6 +- ...MessageConvertersRestClientCustomizer.java | 4 +- .../AbstractErrorWebExceptionHandler.java | 8 +-- .../client/ReactorNettyHttpClientMapper.java | 6 +- .../DispatcherServletRegistrationBean.java | 4 +- .../web/servlet/WebMvcProperties.java | 6 +- .../error/AbstractErrorController.java | 4 +- .../servlet/error/BasicErrorController.java | 4 +- .../webservices/WebServicesProperties.java | 8 +-- .../cache/CacheAutoConfigurationTests.java | 4 +- .../domain/EntityScanPackagesTests.java | 10 ++-- .../domain/EntityScannerTests.java | 4 +- .../h2/H2ConsolePropertiesTests.java | 8 +-- ...ceptionTranslatorExecuteListenerTests.java | 4 +- .../ConditionEvaluationReportLoggerTests.java | 4 +- .../pulsar/PulsarPropertiesTests.java | 8 +-- .../reactive/StaticResourceRequestTests.java | 6 +- .../servlet/StaticResourceRequestTests.java | 6 +- .../TemplateAvailabilityProvidersTests.java | 18 +++--- ...geConvertersRestClientCustomizerTests.java | 4 +- .../ReactorNettyHttpClientMapperTests.java | 6 +- ...ispatcherServletRegistrationBeanTests.java | 4 +- .../web/servlet/WebMvcPropertiesTests.java | 4 +- .../WebServicesAutoConfigurationTests.java | 4 +- .../WebServicesPropertiesTests.java | 8 +-- .../autoconfigure/TriggerFileFilter.java | 4 +- .../classpath/ClassPathChangedEvent.java | 4 +- .../ClassPathFileChangeListener.java | 6 +- .../classpath/ClassPathFileSystemWatcher.java | 6 +- .../boot/devtools/filewatch/ChangedFile.java | 8 +-- .../devtools/filewatch/DirectorySnapshot.java | 10 ++-- .../boot/devtools/filewatch/FileSnapshot.java | 6 +- .../devtools/filewatch/FileSystemWatcher.java | 20 +++---- .../boot/devtools/livereload/Frame.java | 6 +- .../client/ClassPathChangeUploader.java | 6 +- .../client/DelayedLiveReloadTrigger.java | 8 +-- .../remote/client/HttpHeaderInterceptor.java | 6 +- .../devtools/remote/server/Dispatcher.java | 6 +- .../remote/server/DispatcherFilter.java | 4 +- .../server/HttpHeaderAccessManager.java | 6 +- .../remote/server/UrlHandlerMapper.java | 6 +- .../boot/devtools/restart/MainMethod.java | 4 +- .../boot/devtools/restart/Restarter.java | 10 ++-- .../restart/classloader/ClassLoaderFile.java | 8 +-- .../restart/classloader/ClassLoaderFiles.java | 12 ++-- .../classloader/RestartClassLoader.java | 6 +- .../restart/server/HttpRestartServer.java | 6 +- .../server/HttpRestartServerHandler.java | 4 +- .../restart/server/RestartServer.java | 6 +- .../autoconfigure/TriggerFileFilterTests.java | 4 +- .../classpath/ClassPathChangedEventTests.java | 4 +- .../ClassPathFileChangeListenerTests.java | 6 +- .../ClassPathFileSystemWatcherTests.java | 4 +- .../devtools/filewatch/ChangedFileTests.java | 8 +-- .../filewatch/DirectorySnapshotTests.java | 10 ++-- .../devtools/filewatch/FileSnapshotTests.java | 6 +- .../filewatch/FileSystemWatcherTests.java | 14 ++--- .../boot/devtools/livereload/FrameTests.java | 6 +- .../client/ClassPathChangeUploaderTests.java | 8 +-- .../client/DelayedLiveReloadTriggerTests.java | 10 ++-- .../client/HttpHeaderInterceptorTests.java | 10 ++-- .../remote/server/DispatcherFilterTests.java | 4 +- .../remote/server/DispatcherTests.java | 6 +- .../server/HttpHeaderAccessManagerTests.java | 10 ++-- .../remote/server/UrlHandlerMapperTests.java | 8 +-- .../devtools/restart/MainMethodTests.java | 4 +- .../boot/devtools/restart/RestarterTests.java | 6 +- .../classloader/ClassLoaderFileTests.java | 10 ++-- .../classloader/ClassLoaderFilesTests.java | 8 +-- .../classloader/RestartClassLoaderTests.java | 6 +- .../server/HttpRestartServerHandlerTests.java | 4 +- .../server/HttpRestartServerTests.java | 6 +- .../restart/server/RestartServerTests.java | 4 +- .../compose/core/DockerComposeFile.java | 14 ++--- .../boot/docker/compose/core/ImageName.java | 11 ++-- .../docker/compose/core/ImageReference.java | 12 ++-- .../connection/ConnectionNamePredicate.java | 4 +- ...DockerComposeConnectionDetailsFactory.java | 4 +- .../connection/jdbc/JdbcUrlBuilder.java | 6 +- .../ConnectionFactoryOptionsBuilder.java | 10 ++-- .../compose/core/DockerComposeFileTests.java | 6 +- .../docker/compose/core/ImageNameTests.java | 13 +++-- .../compose/core/ImageReferenceTests.java | 6 +- .../connection/jdbc/JdbcUrlBuilderTests.java | 6 +- .../ConnectionFactoryOptionsBuilderTests.java | 8 +-- .../MyEnvironmentPostProcessor.java | 4 +- .../filter/FilterAnnotations.java | 10 ++-- .../jdbc/TestDatabaseAutoConfiguration.java | 4 +- .../orm/jpa/TestEntityManager.java | 4 +- .../SpringBootMockMvcBuilderCustomizer.java | 4 +- .../orm/jpa/TestEntityManagerTests.java | 4 +- .../test/context/AnnotatedClassFinder.java | 8 +-- .../assertj/ApplicationContextAssert.java | 12 ++-- .../ApplicationContextAssertProvider.java | 10 ++-- .../AbstractApplicationContextRunner.java | 14 ++--- .../test/context/runner/ContextConsumer.java | 4 +- .../test/json/AbstractJsonMarshalTester.java | 32 +++++------ .../boot/test/json/BasicJsonTester.java | 4 +- .../boot/test/json/GsonTester.java | 6 +- .../boot/test/json/JacksonTester.java | 6 +- .../boot/test/json/JsonContent.java | 8 +-- .../boot/test/json/JsonContentAssert.java | 4 +- .../boot/test/json/JsonbTester.java | 6 +- .../boot/test/json/ObjectContent.java | 4 +- .../test/mock/mockito/MockDefinition.java | 4 +- .../boot/test/mock/mockito/MockReset.java | 4 +- .../mock/mockito/MockitoPostProcessor.java | 9 ++- .../boot/test/mock/mockito/SpyDefinition.java | 6 +- .../boot/test/util/TestPropertyValues.java | 12 ++-- .../client/LocalHostUriTemplateHandler.java | 6 +- .../MockServerRestClientCustomizer.java | 6 +- .../MockServerRestTemplateCustomizer.java | 6 +- .../RootUriRequestExpectationManager.java | 8 +-- .../test/web/client/TestRestTemplate.java | 4 +- .../test/web/htmlunit/LocalHostWebClient.java | 4 +- .../LocalHostWebConnectionHtmlUnitDriver.java | 10 ++-- .../context/AnnotatedClassFinderTests.java | 6 +- ...ApplicationContextAssertProviderTests.java | 12 ++-- .../ApplicationContextAssertTests.java | 4 +- .../context/runner/ContextConsumerTests.java | 4 +- .../json/AbstractJsonMarshalTesterTests.java | 6 +- .../boot/test/json/BasicJsonTesterTests.java | 4 +- .../boot/test/json/GsonTesterTests.java | 6 +- .../boot/test/json/JacksonTesterTests.java | 6 +- .../boot/test/json/JsonContentTests.java | 8 +-- .../boot/test/json/JsonbTesterTests.java | 6 +- .../boot/test/json/ObjectContentTests.java | 4 +- .../mock/mockito/MockDefinitionTests.java | 4 +- .../test/mock/mockito/SpyDefinitionTests.java | 6 +- .../LocalHostUriTemplateHandlerTests.java | 8 +-- .../MockServerRestClientCustomizerTests.java | 6 +- ...MockServerRestTemplateCustomizerTests.java | 6 +- ...RootUriRequestExpectationManagerTests.java | 6 +- .../web/htmlunit/LocalHostWebClientTests.java | 4 +- ...lHostWebConnectionHtmlUnitDriverTests.java | 10 ++-- .../TestcontainersPropertySource.java | 4 +- .../ContainerConnectionDetailsFactory.java | 6 +- .../service/connection/FieldOrigin.java | 4 +- .../service/connection/FieldOriginTests.java | 4 +- .../buildpack/platform/build/BuildOwner.java | 4 +- .../platform/build/BuildRequest.java | 48 ++++++++-------- .../buildpack/platform/build/Builder.java | 10 ++-- .../platform/build/BuilderMetadata.java | 4 +- .../build/BuildpackLayersMetadata.java | 4 +- .../platform/build/BuildpackMetadata.java | 4 +- .../platform/build/BuildpackReference.java | 4 +- .../platform/build/BuildpackResolvers.java | 6 +- .../boot/buildpack/platform/build/Cache.java | 8 +-- .../buildpack/platform/build/Creator.java | 4 +- .../platform/build/LifecycleVersion.java | 14 ++--- .../buildpack/platform/build/StackId.java | 6 +- .../buildpack/platform/docker/DockerApi.java | 46 +++++++-------- .../platform/docker/TotalProgressEvent.java | 4 +- .../configuration/DockerConfiguration.java | 16 +++--- .../transport/DockerConnectionException.java | 6 +- .../transport/DockerEngineException.java | 6 +- .../docker/transport/HttpClientTransport.java | 6 +- .../platform/docker/type/ApiVersion.java | 9 +-- .../platform/docker/type/Binding.java | 10 ++-- .../platform/docker/type/ContainerConfig.java | 10 ++-- .../docker/type/ContainerContent.java | 6 +- .../docker/type/ContainerReference.java | 4 +- .../platform/docker/type/ImageArchive.java | 8 +-- .../platform/docker/type/ImageName.java | 11 ++-- .../platform/docker/type/ImagePlatform.java | 8 +-- .../platform/docker/type/ImageReference.java | 17 +++--- .../buildpack/platform/docker/type/Layer.java | 6 +- .../platform/docker/type/LayerId.java | 10 ++-- .../platform/docker/type/RandomString.java | 4 +- .../platform/docker/type/VolumeName.java | 14 ++--- .../boot/buildpack/platform/io/Content.java | 12 ++-- .../platform/io/FilePermissions.java | 6 +- .../platform/io/InspectedContent.java | 8 +-- .../platform/io/ZipFileTarArchive.java | 6 +- .../platform/build/BuildOwnerTests.java | 4 +- .../platform/build/BuildRequestTests.java | 22 ++++---- .../platform/build/BuilderMetadataTests.java | 4 +- .../platform/build/BuilderTests.java | 4 +- .../build/BuildpackLayersMetadataTests.java | 4 +- .../build/BuildpackMetadataTests.java | 4 +- .../build/BuildpackReferenceTests.java | 4 +- .../platform/build/ImageBuildpackTests.java | 2 +- .../platform/build/LifecycleVersionTests.java | 8 +-- .../platform/build/StackIdTests.java | 4 +- .../platform/docker/DockerApiTests.java | 40 ++++++------- .../docker/TotalProgressEventTests.java | 6 +- .../DockerConnectionExceptionTests.java | 6 +- .../transport/DockerEngineExceptionTests.java | 6 +- .../platform/docker/type/ApiVersionTests.java | 8 +-- .../platform/docker/type/BindingTests.java | 10 ++-- .../docker/type/ContainerConfigTests.java | 6 +- .../docker/type/ContainerContentTests.java | 8 +-- .../docker/type/ContainerReferenceTests.java | 6 +- .../platform/docker/type/ImageNameTests.java | 13 +++-- .../docker/type/ImagePlatformTests.java | 6 +- .../docker/type/ImageReferenceTests.java | 10 ++-- .../platform/docker/type/LayerIdTests.java | 10 ++-- .../platform/docker/type/LayerTests.java | 6 +- .../docker/type/RandomStringTests.java | 4 +- .../platform/docker/type/VolumeNameTests.java | 16 +++--- .../buildpack/platform/io/ContentTests.java | 10 ++-- .../platform/io/InspectedContentTests.java | 8 +-- .../platform/io/ZipFileTarArchiveTests.java | 6 +- .../boot/cli/command/CommandRunner.java | 10 ++-- .../BootBuildImageIntegrationTests.java | 6 +- .../boot/maven/FilterableDependency.java | 4 +- .../boot/BeanDefinitionLoader.java | 8 +-- .../boot/DefaultApplicationArguments.java | 4 +- .../boot/DefaultBootstrapContext.java | 6 +- .../boot/ExitCodeGenerators.java | 20 +++---- .../springframework/boot/ResourceBanner.java | 6 +- .../boot/SpringApplication.java | 14 ++--- .../boot/SpringApplicationShutdownHook.java | 6 +- .../boot/StartupInfoLogger.java | 4 +- ...SpringApplicationAdminMXBeanRegistrar.java | 4 +- .../boot/ansi/Ansi8BitColor.java | 4 +- .../springframework/boot/ansi/AnsiOutput.java | 4 +- .../ApplicationAvailabilityBean.java | 6 +- .../availability/AvailabilityChangeEvent.java | 6 +- .../context/ApplicationPidFileWriter.java | 6 +- .../context/annotation/Configurations.java | 6 +- .../boot/context/config/ConfigData.java | 8 +-- .../ConfigDataLocationNotFoundException.java | 4 +- .../ConfigDataResourceNotFoundException.java | 4 +- .../config/ConfigTreeConfigDataResource.java | 6 +- .../config/StandardConfigDataResource.java | 6 +- .../BoundConfigurationProperties.java | 4 +- .../ConfigurationPropertiesBean.java | 4 +- ...urationPropertiesBindingPostProcessor.java | 4 +- .../context/properties/PropertyMapper.java | 24 ++++---- .../properties/bind/AbstractBindHandler.java | 4 +- .../context/properties/bind/BindResult.java | 6 +- .../context/properties/bind/Bindable.java | 10 ++-- .../bind/BindableRuntimeHintsRegistrar.java | 6 +- .../boot/context/properties/bind/Binder.java | 10 ++-- .../BoundPropertiesTrackingBindHandler.java | 4 +- .../PropertySourcesPlaceholdersResolver.java | 6 +- .../validation/BindValidationException.java | 4 +- .../bind/validation/ValidationErrors.java | 8 +-- .../AliasedConfigurationPropertySource.java | 10 ++-- .../source/ConfigurationProperty.java | 6 +- .../source/ConfigurationPropertyCaching.java | 4 +- .../ConfigurationPropertyNameAliases.java | 10 ++-- .../source/ConfigurationPropertyState.java | 6 +- ...FilteredConfigurationPropertiesSource.java | 6 +- ...idConfigurationPropertyValueException.java | 4 +- .../MapConfigurationPropertySource.java | 4 +- ...usiveConfigurationPropertiesException.java | 6 +- .../PrefixedConfigurationPropertySource.java | 6 +- .../SpringConfigurationPropertySource.java | 8 +-- .../SpringConfigurationPropertySources.java | 4 +- .../DelimitedStringToArrayConverter.java | 4 +- .../DelimitedStringToCollectionConverter.java | 4 +- .../boot/convert/DurationStyle.java | 4 +- .../boot/convert/PeriodStyle.java | 2 +- .../boot/env/ConfigTreePropertySource.java | 6 +- .../env/OriginTrackedPropertiesLoader.java | 4 +- .../boot/info/InfoProperties.java | 4 +- .../boot/jackson/JsonComponentModule.java | 4 +- .../boot/jackson/JsonObjectDeserializer.java | 6 +- .../boot/jdbc/DataSourceBuilder.java | 2 +- .../boot/jdbc/DatabaseDriver.java | 4 +- .../boot/jdbc/EmbeddedDatabaseConnection.java | 4 +- ...formPlaceholderDatabaseDriverResolver.java | 6 +- .../boot/logging/DeferredLog.java | 4 +- .../springframework/boot/logging/LogFile.java | 4 +- .../boot/logging/LoggerConfiguration.java | 12 ++-- .../LoggerConfigurationComparator.java | 4 +- .../boot/logging/LoggingSystemProperties.java | 4 +- .../boot/logging/java/JavaLoggingSystem.java | 4 +- .../logging/log4j2/Log4J2LoggingSystem.java | 2 +- .../logging/log4j2/StructuredLogLayout.java | 4 +- .../logging/logback/LogbackConfigurator.java | 6 +- .../boot/origin/OriginTrackedResource.java | 4 +- .../boot/origin/PropertySourceOrigin.java | 6 +- .../boot/origin/SystemEnvironmentOrigin.java | 5 +- .../orm/jpa/hibernate/SpringJtaPlatform.java | 4 +- .../boot/r2dbc/ConnectionFactoryBuilder.java | 4 +- .../r2dbc/EmbeddedDatabaseConnection.java | 2 +- .../context/RSocketServerBootstrap.java | 4 +- .../rsocket/netty/NettyRSocketServer.java | 4 +- .../netty/NettyRSocketServerFactory.java | 6 +- ...cationContextServerWebExchangeMatcher.java | 4 +- .../ApplicationContextRequestMatcher.java | 4 +- .../boot/ssl/DefaultSslBundleRegistry.java | 12 ++-- .../boot/ssl/SslManagerBundle.java | 6 +- .../boot/ssl/jks/JksSslStoreBundle.java | 4 +- .../boot/ssl/pem/LoadedPemSslStore.java | 6 +- .../boot/ssl/pem/PemContent.java | 4 +- .../boot/ssl/pem/PemSslStore.java | 4 +- .../task/SimpleAsyncTaskExecutorBuilder.java | 10 ++-- .../task/ThreadPoolTaskExecutorBuilder.java | 10 ++-- .../task/ThreadPoolTaskSchedulerBuilder.java | 8 +-- .../boot/util/Instantiator.java | 6 +- .../springframework/boot/util/LambdaSafe.java | 14 ++--- .../boot/web/client/BasicAuthentication.java | 6 +- .../client/ClientHttpRequestFactories.java | 6 +- .../boot/web/client/RestTemplateBuilder.java | 56 +++++++++---------- .../web/client/RootUriBuilderFactory.java | 4 +- .../web/client/RootUriTemplateHandler.java | 8 +-- .../web/context/WebServerPortFileWriter.java | 4 +- .../jetty/JettyReactiveWebServerFactory.java | 6 +- .../jetty/JettyServletWebServerFactory.java | 16 +++--- .../web/embedded/jetty/JettyWebServer.java | 4 +- ...ervletContextInitializerConfiguration.java | 4 +- .../netty/NettyReactiveWebServerFactory.java | 8 +-- .../web/embedded/netty/NettyWebServer.java | 4 +- .../TomcatReactiveWebServerFactory.java | 24 ++++---- .../tomcat/TomcatServletWebServerFactory.java | 34 +++++------ .../web/embedded/tomcat/TomcatWebServer.java | 4 +- .../UndertowServletWebServerFactory.java | 6 +- .../UndertowWebServerFactoryDelegate.java | 6 +- ...igReactiveWebServerApplicationContext.java | 6 +- .../reactive/context/WebServerManager.java | 4 +- .../AbstractConfigurableWebServerFactory.java | 6 +- .../ErrorPageRegistrarBeanPostProcessor.java | 5 +- .../boot/web/server/MimeMappings.java | 24 ++++---- ...verFactoryCustomizerBeanPostProcessor.java | 5 +- .../AbstractFilterRegistrationBean.java | 18 +++--- ...DelegatingFilterProxyRegistrationBean.java | 2 +- .../web/servlet/DynamicRegistrationBean.java | 8 +-- .../web/servlet/FilterRegistrationBean.java | 6 +- .../ServletListenerRegistrationBean.java | 12 ++-- .../web/servlet/ServletRegistrationBean.java | 10 ++-- ...ionConfigServletWebApplicationContext.java | 6 +- ...figServletWebServerApplicationContext.java | 6 +- ...onContextServletContextAwareProcessor.java | 4 +- .../AbstractServletWebServerFactory.java | 16 +++--- .../server/CookieSameSiteSupplier.java | 14 ++--- .../HttpWebServiceMessageSenderBuilder.java | 8 +-- .../client/WebServiceTemplateBuilder.java | 38 ++++++------- .../DefaultApplicationArgumentsTests.java | 4 +- .../boot/DefaultBootstrapContextTests.java | 6 +- .../boot/ExitCodeGeneratorsTests.java | 6 +- .../SpringApplicationShutdownHookTests.java | 6 +- .../boot/SpringApplicationTests.java | 2 +- .../boot/ansi/Ansi8BitColorTests.java | 10 ++-- .../annotation/ConfigurationsTests.java | 4 +- ...figDataLocationNotFoundExceptionTests.java | 4 +- ...figDataResourceNotFoundExceptionTests.java | 4 +- .../boot/context/config/ConfigDataTests.java | 6 +- .../ConfigTreeConfigDataResourceTests.java | 6 +- .../StandardConfigDataResourceTests.java | 6 +- .../properties/PropertyMapperTests.java | 8 +-- .../properties/bind/BindResultTests.java | 6 +- .../properties/bind/BindableTests.java | 8 +-- .../context/properties/bind/BinderTests.java | 14 ++--- ...pertySourcesPlaceholdersResolverTests.java | 4 +- .../BindValidationExceptionTests.java | 4 +- .../validation/ValidationErrorsTests.java | 8 +-- .../ConfigurationPropertyCachingTests.java | 4 +- ...ConfigurationPropertyNameAliasesTests.java | 4 +- .../ConfigurationPropertyStateTests.java | 6 +- .../source/ConfigurationPropertyTests.java | 6 +- ...redConfigurationPropertiesSourceTests.java | 6 +- .../MapConfigurationPropertySourceTests.java | 6 +- ...ConfigurationPropertiesExceptionTests.java | 10 ++-- ...pringConfigurationPropertySourceTests.java | 6 +- ...ringConfigurationPropertySourcesTests.java | 4 +- ...rableConfigurationPropertySourceTests.java | 4 +- .../boot/convert/DurationStyleTests.java | 4 +- .../boot/convert/PeriodStyleTests.java | 4 +- .../env/ConfigTreePropertySourceTests.java | 6 +- .../jackson/JsonObjectDeserializerTests.java | 6 +- .../boot/jdbc/DatabaseDriverTests.java | 4 +- .../jdbc/EmbeddedDatabaseConnectionTests.java | 6 +- .../logging/LoggerConfigurationTests.java | 16 +++--- .../origin/PropertySourceOriginTests.java | 8 +-- ...nContextServerWebExchangeMatcherTests.java | 4 +- ...ApplicationContextRequestMatcherTests.java | 4 +- .../ssl/DefaultSslBundleRegistryTests.java | 8 +-- .../boot/ssl/SslManagerBundleTests.java | 6 +- .../boot/ssl/pem/PemSslStoreTests.java | 6 +- .../SimpleAsyncTaskExecutorBuilderTests.java | 10 ++-- .../ThreadPoolTaskExecutorBuilderTests.java | 10 ++-- .../ThreadPoolTaskSchedulerBuilderTests.java | 8 +-- .../boot/util/LambdaSafeTests.java | 6 +- .../web/client/RestTemplateBuilderTests.java | 38 ++++++------- .../client/RootUriTemplateHandlerTests.java | 6 +- .../JettyReactiveWebServerFactoryTests.java | 6 +- .../TomcatReactiveWebServerFactoryTests.java | 12 ++-- .../TomcatServletWebServerFactoryTests.java | 16 +++--- ...UndertowReactiveWebServerFactoryTests.java | 6 +- .../UndertowServletWebServerFactoryTests.java | 10 ++-- ...ctoryCustomizerBeanPostProcessorTests.java | 4 +- .../AbstractFilterRegistrationBeanTests.java | 14 ++--- ...atingFilterProxyRegistrationBeanTests.java | 8 +-- .../servlet/FilterRegistrationBeanTests.java | 8 +-- .../ServletListenerRegistrationBeanTests.java | 4 +- .../servlet/ServletRegistrationBeanTests.java | 8 +-- .../server/CookieSameSiteSupplierTests.java | 18 +++--- .../WebServiceTemplateBuilderTests.java | 26 ++++----- .../smoketest/data/jpa/domain/Review.java | 6 +- .../data/jpa/service/CitySearchCriteria.java | 4 +- .../data/jpa/service/CityServiceImpl.java | 15 ++--- .../data/jpa/service/HotelServiceImpl.java | 10 ++-- .../data/rest/service/CitySearchCriteria.java | 4 +- .../main/java/smoketest/test/domain/User.java | 6 +- .../domain/VehicleIdentificationNumber.java | 6 +- .../service/RemoteVehicleDetailsService.java | 4 +- .../test/service/VehicleDetails.java | 6 +- .../test/web/UserVehicleService.java | 4 +- .../test/domain/UserEntityTests.java | 8 +-- .../VehicleIdentificationNumberTests.java | 8 +-- .../RemoteVehicleDetailsServiceTests.java | 4 +- .../test/web/UserVehicleServiceTests.java | 4 +- 559 files changed, 2001 insertions(+), 2003 deletions(-) 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 f93303feccd9..52024639dd77 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 66975852e7cd..daae8f4edf07 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 18ac9811b3df..e42d2e41428b 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 9be59775512b..4a839437592f 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 00affa4cfff3..07b3dc1840ef 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 IncludeExcludeEndpointFilter(Class endpointType, Collection in 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 @@ private IncludeExcludeEndpointFilter(Class endpointType, Environment environm 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 06a9223eaf62..5201b917676a 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 String getBasePath() { } 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 3b5aeda866da..9c590d64e7af 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 @@ protected AbstractCompositeHealthContributorConfiguration(Function indicat } protected final C createContributor(Map 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 a94172671e92..a925ce1b5e0b 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 HealthContributor dbHealthContributor(Map dataSources } 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 b257f66c4fb4..51ba32514837 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 bf506756478a..89db89f76aa4 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 4cc34a988868..8b0371139aa3 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 f2b625463ad2..1a98b24302a5 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 DataSize getThreshold() { } 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 dfd3f495ae7c..aaf3311d6969 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 a44f8ce0e035..1b7a5b18adcf 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 @@ static SpanExporters of(SpanExporter... spanExporters) { * @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 ca8c55498d07..30cda9f7f741 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 @@ static SpanProcessors of(SpanProcessor... spanProcessors) { * @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 2759ca4d1345..f4a814d47ecf 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 ae5dfc538455..caae873f31a1 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 @@ void setup() { @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 75737180e4a3..a8e1a0df42cc 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 441d15bf6645..318057ac2d20 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 @@ void basePathShouldBeCleaned() { 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 e769d93ef3ca..3cc279899ecc 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 e1db8683bb46..1437d65e7c52 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 20b28b81b61c..18675cfbb124 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 @@ void thresholdMustBePositive() { .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 386da31a9bc8..e4861b0bcc47 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 e943f2d137a5..2fd00f99e25e 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 AuditEvent(String principal, String type, String... data) { * @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 57a2f1f0cfdd..cf001c1d44f9 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 06433c621e4b..668cd2074631 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 void setCapacity(int capacity) { @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 dd0e6f42f33e..f9fc139a80c7 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 AuditApplicationEvent(Instant timestamp, String principal, String type, M */ 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 e1b73a241011..34132169246f 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 ed42a0bbda6a..c43e35f27393 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 646560d0788c..eab8119ed9fc 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 cefa92cc5424..3529270eb3a7 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 39a3b6bb1428..9b5dd830400c 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 eaa3fbab86d9..69bd07271417 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 96108afa5388..8817fd94dcae 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 AbstractExposableEndpoint(EndpointId id, boolean enabledByDefault, Collec * @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 c810d540b20c..416f28d3c0ec 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 269ca381aca3..a9e33ea65113 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 static EndpointId of(String value) { * @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 3369570c391e..e1853cf9c8d7 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 9ade2ec523d9..539f92fa5e08 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 72a581810331..0d61efd84390 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 AbstractDiscoveredEndpoint(EndpointDiscoverer discoverer, Object en 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 4cf89333a905..e72059365c14 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 45c0354b880a..154051a8149f 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 d28113bbb268..0111225dc36b 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 EndpointDiscoverer(ApplicationContext applicationContext, ParameterValueM 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 @@ protected static final class OperationKey { * @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 3d185879ed51..666b00ea2c22 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 ConversionServiceParameterValueMapper() { * @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 242de67e743c..441b4334c991 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 d81826a8603d..171b8ffb5164 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 7f8f3960b4f1..505a2e2f8527 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 8cd51645de92..df24c8e0c34b 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 845e9707c7e5..1bb56a0ddb28 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 7c7f147db521..b0c0e7d5cdd3 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 b46accae7538..58be89d54fcb 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 EndpointMediaTypes(List producedAndConsumed) { * @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 6f7b9e83ae16..a419c1e827c7 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 EndpointServlet(Class servlet) { } 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 EndpointServlet(Servlet servlet) { } 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 f0e1b9bcb366..86b84dec0dd4 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 96995b2e0daf..aa1946124ac2 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 PathMappedEndpoints(String basePath, EndpointsSupplier supplier) { * @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 ba59d987cf3f..52639110ca20 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 13508e7c87b8..3c82519d1c39 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 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 1f9557bc8e0a..adcd4d52844e 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 8591199e0b16..a2f2d5142c84 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 ControllerEndpointHandlerMapping(EndpointMapping endpointMapping, 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 b7085b91717e..267614cdf7d1 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 ControllerEndpointHandlerMapping(EndpointMapping endpointMapping, 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 d28b82a8e7d6..694ebec52a97 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 ebf13309c9e0..a89f26f8b2ac 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 @@ protected AbstractHealthIndicator(String healthCheckFailedMessage) { * @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 0b6e2c792693..81ffd0a3234d 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 @@ protected AbstractReactiveHealthIndicator(String healthCheckFailedMessage) { * @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 2b3cccd09695..2ac395be5057 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 String toString() { * @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 static AdditionalHealthEndpointPath from(String value) { * @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 6f1a8b7c247c..94e808aae59d 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 41dace35eec9..4cb6560332d0 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 faae11ae445b..7e209c2ce070 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 @@ public void registerContributor(String name, C contributor) { @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 b0a063414fcc..ec50576cbc4a 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 Builder() { * @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 Builder(Status status) { * @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 Builder withException(Throwable ex) { * @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 Builder withDetail(String key, Object value) { * @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 87e3deb4935e..87170a24dd4b 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 @@ default HealthEndpointGroup get(AdditionalHealthEndpointPath path) { * @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 @@ default Set getAllWithAdditionalPath(WebServerNamespace nam * @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 79445877bd62..c3b30aa35918 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 0e9609bda449..ae231c55be7e 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 3922eeb4e92e..9bf96859d382 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 e8ed933cbbac..833d13a2884f 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 0519c5c26871..2806e1ab5437 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 @@ 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 d4113e57a6fb..81ec7f655d4d 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 Status(String code) { * @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 2c48fc18d2df..d293d6eb1413 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 ca841638d339..fce74e4a2918 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 2000e549b62f..d02a3bbf449a 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 a7474dd18879..233b020112b0 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 b46eb95a8d47..dc25b1cf7f27 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 @@ private Map getGroups() { @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 LoggerLevelsDescriptor loggerLevels(@Selector String name) { @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 911f858e57ac..6054386f180a 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 dc3ebe4d31ac..da9061c3223d 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 PrometheusPushGatewayManager(PushGateway pushGateway, CollectorRegistry r */ 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 f22023a1ef24..afa0efc3603e 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 DataSourcePoolMetrics(DataSource dataSource, Collection 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 d2bcf25ce0d4..e19a43f93f24 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 904e94260340..7ae543714d80 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 e6cdde6920d2..a858b375fd6e 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 d1c3d942cbaf..07a0fcd1c26f 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 ConnectionFactoryHealthIndicator(ConnectionFactory connectionFactory) { * 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 9ee15d69fc02..d8e6bfe75599 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 1b89c83a1132..d09c88cb5061 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 SessionsEndpoint(FindByIndexNameSessionRepository sess */ 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 a68370932767..321e660ef204 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 63856b2f16b8..4a10bee81566 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 97b3cd270ff4..768742024206 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 @@ void nullPrincipalIsMappedToEmptyString() { 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 cb1ab5395691..da400a148df1 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 @@ void capacity() { 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 ea48c0a17cfa..cc40f23f6318 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 @@ void createWhenApplicationAvailabilityIsNullThrowsException() { 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 @@ void createWhenStateTypeIsNullThrowsException() { 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 @@ void createWhenStatusMappingIsNullThrowsException() { 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 bc57d0a1d05b..687010d0563d 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 84f2a83279cb..41f59d2f53a6 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 @@ void whenCreatedWithoutApiVersionThenResolveApiVersionReturnsLatestVersion() { @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 9c85115b4161..f04764af6ce6 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 @@ void createWhenAnnotationAttributesIsNullShouldThrowException() { 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 b457b2fa951d..ecaa0a2f36d5 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 131e0e76ef72..2c3dc531f4ec 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 @@ void createWhenApplicationContextIsNullShouldThrowException() { 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 @@ void createWhenParameterValueMapperIsNullShouldThrowException() { 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 @@ void createWhenInvokerAdvisorsIsNullShouldThrowException() { 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 @@ void createWhenFiltersIsNullShouldThrowException() { 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 7f7a1f12bbec..8c2d7ebf1181 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 46dea6abe312..bc4856fbd251 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 9e7cab081a6d..a59cbabd6b2e 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 @@ void setup() { 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 33f89600192d..477c9e07942a 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 442bd367c948..6a8d59f4b470 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 cfd0a8d21622..641529a2f120 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 @@ void createWhenMBeanServerIsNullShouldThrowException() { 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 @@ void createWhenEndpointsIsNullShouldThrowException() { 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 a9495d188e51..ae672f956869 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 @@ void defaultReturnsExpectedProducedAndConsumedTypes() { @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 1a1d8cf247bb..91eaec87ac7f 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 65f5a43183ca..104e56bb1283 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 1d5b2b466c15..38d4865b1d20 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 6e9c9dacae1b..2c698bcdda82 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 1a2916ad08b2..7b37f84eec76 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 0d8d51112eee..57b70b3ace28 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 a9e8058a563f..6f16226f1e01 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 8af31ccdbf44..59e08c0430e9 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 5f0aba842170..990b0493af6d 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 a26c1e460e55..abab9106ab78 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 @@ void ofNameAndContributorCreatesContributor() { @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 9794a32b09cf..b673d85c5698 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 @@ void createWhenMapContainsNullValueThrowsException() { 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 @@ void createWhenMapContainsNullKeyThrowsException() { 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 @@ void createWhenMapContainsKeyWithSlashThrowsException() { 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 2acf5a61f3ca..545c5217c6c1 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 f9284dd4331d..91f27a99643c 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 6960ea722752..d14202c1dd97 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 @@ void createWhenPushGatewayIsNullThrowsException() { 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 @@ void createWhenCollectorRegistryIsNullThrowsException() { 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 @@ void createWhenSchedulerIsNullThrowsException() { 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 @@ void createWhenPushRateIsNullThrowsException() { 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 @@ void createWhenJobIsEmptyThrowsException() { 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 043da47b27c3..4dee33cacd2a 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 d5f1a12c6666..5a3bc1cb0d10 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 @@ protected AbstractConnectionFactoryConfigurer(RabbitProperties properties) { */ protected AbstractConnectionFactoryConfigurer(RabbitProperties properties, RabbitConnectionDetails connectionDetails) { - Assert.notNull(properties, "Properties must not be null"); - Assert.notNull(connectionDetails, "ConnectionDetails must not be null"); + Assert.notNull(properties, "'properties' must not be null"); + Assert.notNull(connectionDetails, "'connectionDetails' must not be null"); this.rabbitProperties = properties; this.connectionDetails = connectionDetails; } @@ -80,7 +80,7 @@ public final void setConnectionNameStrategy(ConnectionNameStrategy connectionNam * @param connectionFactory connection factory to configure */ public final void configure(T connectionFactory) { - Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); + Assert.notNull(connectionFactory, "'connectionFactory' must not be null"); PropertyMapper map = PropertyMapper.get(); String addresses = this.connectionDetails.getAddresses() .stream() diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java index dd91f59e90bf..fffff6a2bb7d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/AbstractRabbitListenerContainerFactoryConfigurer.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,9 +108,9 @@ protected final RabbitProperties getRabbitProperties() { protected void configure(T factory, ConnectionFactory connectionFactory, RabbitProperties.AmqpContainer configuration) { - Assert.notNull(factory, "Factory must not be null"); - Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); - Assert.notNull(configuration, "Configuration must not be null"); + Assert.notNull(factory, "'factory' must not be null"); + Assert.notNull(connectionFactory, "'connectionFactory' must not be null"); + Assert.notNull(configuration, "'configuration' must not be null"); factory.setConnectionFactory(connectionFactory); if (this.messageConverter != null) { factory.setMessageConverter(this.messageConverter); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitConnectionFactoryBeanConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitConnectionFactoryBeanConfigurer.java index 2f59e2d8faed..78ab9806f23a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitConnectionFactoryBeanConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitConnectionFactoryBeanConfigurer.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. @@ -90,9 +90,9 @@ public RabbitConnectionFactoryBeanConfigurer(ResourceLoader resourceLoader, Rabb */ public RabbitConnectionFactoryBeanConfigurer(ResourceLoader resourceLoader, RabbitProperties properties, RabbitConnectionDetails connectionDetails, SslBundles sslBundles) { - Assert.notNull(resourceLoader, "ResourceLoader must not be null"); - Assert.notNull(properties, "Properties must not be null"); - Assert.notNull(connectionDetails, "ConnectionDetails must not be null"); + Assert.notNull(resourceLoader, "'resourceLoader' must not be null"); + Assert.notNull(properties, "'properties' must not be null"); + Assert.notNull(connectionDetails, "'connectionDetails' must not be null"); this.resourceLoader = resourceLoader; this.rabbitProperties = properties; this.connectionDetails = connectionDetails; @@ -115,7 +115,7 @@ public void setCredentialsRefreshService(CredentialsRefreshService credentialsRe * @param factory the {@link RabbitConnectionFactoryBean} instance to configure */ public void configure(RabbitConnectionFactoryBean factory) { - Assert.notNull(factory, "RabbitConnectionFactoryBean must not be null"); + Assert.notNull(factory, "'factory' must not be null"); factory.setResourceLoader(this.resourceLoader); Address address = this.connectionDetails.getFirstAddress(); PropertyMapper map = PropertyMapper.get(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitTemplateConfigurer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitTemplateConfigurer.java index d002323c7416..668342908e31 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitTemplateConfigurer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitTemplateConfigurer.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 class RabbitTemplateConfigurer { * @since 2.6.0 */ public RabbitTemplateConfigurer(RabbitProperties rabbitProperties) { - Assert.notNull(rabbitProperties, "RabbitProperties must not be null"); + Assert.notNull(rabbitProperties, "'rabbitProperties' must not be null"); this.rabbitProperties = rabbitProperties; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherApplicationRunner.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherApplicationRunner.java index 1f66570f0d3d..c96ef4e693d5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherApplicationRunner.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherApplicationRunner.java @@ -102,9 +102,9 @@ public class JobLauncherApplicationRunner * when running a job */ public JobLauncherApplicationRunner(JobLauncher jobLauncher, JobExplorer jobExplorer, JobRepository jobRepository) { - Assert.notNull(jobLauncher, "JobLauncher must not be null"); - Assert.notNull(jobExplorer, "JobExplorer must not be null"); - Assert.notNull(jobRepository, "JobRepository must not be null"); + Assert.notNull(jobLauncher, "'jobLauncher' must not be null"); + Assert.notNull(jobExplorer, "'jobExplorer' must not be null"); + Assert.notNull(jobRepository, "'jobRepository' must not be null"); this.jobLauncher = jobLauncher; this.jobExplorer = jobExplorer; this.jobRepository = jobRepository; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java index 62ce77a7184c..6ce79076deb5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.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. @@ -102,7 +102,7 @@ public Redis getRedis() { public Resource resolveConfigLocation(Resource config) { if (config != null) { Assert.isTrue(config.exists(), - () -> "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 1a317b0b5fe7..82a8d5460a76 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 3126167f106e..702a456d8235 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 @@ private 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 void recordConditionEvaluation(String source, Condition condition, Condit * @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 void recordExclusions(Collection exclusions) { * 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 9b0a0a40a170..1f4e2c898a3f 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 ConditionMessage append(String message) { * @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 Builder andCondition(Class condition, Object... det * @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 ConditionMessage items(Collection items) { * @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 ebaa1ae33b6b..da09605f4c3c 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 ConditionOutcome(boolean match, String message) { * @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 ba0f6a1a95f0..381db02c36f5 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 @@ static class GridFsMongoDatabaseFactory implements MongoDatabaseFactory { 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 b423e61ab2eb..047f6b237991 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 @@ static Standalone of(String host, int port) { } 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 10d5f2159614..96a4d0f34b1b 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 82c0ce9178f3..0da1e3229844 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 static EntityScanPackages get(BeanFactory beanFactory) { * @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 static void register(BeanDefinitionRegistry registry, String... packageNa * @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 4fb4efd0a9d3..8b291eb82fa8 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 444270cb05f5..cdd3f1f1d624 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 FlywayMigrationInitializer(Flyway flyway) { * @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 a1dc97a034fb..09dba6b7b56b 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 String getPath() { } 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 af5054c9eb28..9ff61bf97dff 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 be9d767d0f26..de88b4b0a368 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 void setObservationRegistry(ObservationRegistry observationRegistry) { * @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 aa9c027540f4..143ff15267ae 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 957c17cc4b84..5fc00df65e3c 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 199a62dda0e0..c6d67c7a7c3a 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 ec59ac43bc2c..dfbeb72350fc 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 String[] determineUrls(Environment environment) { } 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 7d1df833225a..0746aa6d6f5c 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 String getChangeLog() { } 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 1af820991ab5..4cd8e566ce03 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 31bcac1d4f53..d2de269fbe99 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 @@ 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 @@ private ConditionEvaluationReportListener(ConfigurableApplicationContext context 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 c01450b1e55e..648ffd9c8340 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 Naming getNaming() { */ 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 3972eec5029f..5ab34e4acfa4 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 Topic getTopic() { 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 record TypeMapping(Class messageType, String topicName, SchemaInfo sch 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 f974fbbacfe2..ff57def944a7 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 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 void setPrincipalClaimName(String principalClaimName) { 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 7d95c338c329..9f9321c047da 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 StaticResourceServerWebExchange at(StaticResourceLocation first, StaticRe * @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 StaticResourceServerWebExchange excluding(StaticResourceLocation first, S * @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 13d6cf92681c..ef8a72bc5cd5 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 StaticResourceRequestMatcher at(StaticResourceLocation first, StaticResou * @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 StaticResourceRequestMatcher excluding(StaticResourceLocation first, Stat * @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 c7b527b00f37..49604a466fcf 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 5ffcdbc83352..f96d2a89e26a 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 f6e2d678fb04..d20aff3900e6 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 TemplateAvailabilityProviders(ApplicationContext applicationContext) { * @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 TemplateAvailabilityProviders(ClassLoader classLoader) { * @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 List getProviders() { * @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 TemplateAvailabilityProvider getProvider(String view, ApplicationContext */ 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 90dd2caf135a..a5adcc4881ea 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 TemplateLocation(String path) { * @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 c5372d5d7f84..0ee1099edd6b 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 c601654d0e42..c7315504d59f 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 2589b002d51a..0134ed8976e3 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 @@ static ReactorNettyHttpClientMapper of(Collection * @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 9c6625cfe996..3eccf8887cfb 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 add6851f2ec0..4a082f2ec35a 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 BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties err 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 9f1014b4c7f2..ab473fab16ee 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 String getPath() { } 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 b29f64cce6cf..e55f864f2679 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 @@ void jCacheCacheWithWrongConfig() { "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 0289be2ee956..ce789779fdb7 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 @@ void getShouldReturnRegisterPackages() { @Test void registerFromArrayWhenRegistryIsNullShouldThrowException() { assertThatIllegalArgumentException().isThrownBy(() -> EntityScanPackages.register(null)) - .withMessageContaining("Registry must not be null"); + .withMessageContaining("'registry' must not be null"); } @@ -78,14 +78,14 @@ void registerFromArrayWhenPackageNamesIsNullShouldThrowException() { 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 @@ void registerFromCollectionWhenPackageNamesIsNullShouldThrowException() { 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 ec707d9c8382..6c3a99c47b6b 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 e60e6abcfa79..bebfd11bf912 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 ae1278889d1b..c4c36b20ff86 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 @@ void createWhenTranslatorFactoryIsNullThrowsException() { 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 c728158876e7..47680a6e04b1 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 @@ void noErrorIfNotInitialized(CapturedOutput output) { 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 72fbdd0e73f4..cfaff0ccd02d 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 @@ void bindWhenNoSchemaThrowsException() { 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 @@ void bindWhenSchemaTypeNoneThrowsException() { 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 @@ void bindWhenMessageKeyTypeSetOnNonKeyValueSchemaThrowsException() { 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 db501b62ae49..0b2f0957d360 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 @@ void atLocationShouldMatchLocation() { @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 e99120b3eed3..7f2fe7869d01 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 @@ void atLocationWhenHasServletPathShouldMatchLocation() { @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 48cc8cb8c578..4591a1d3eca5 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 @@ void setup() { 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 @@ void createWhenUsingApplicationContextShouldLoadProviders() { @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 @@ void createWhenUsingClassLoaderShouldLoadProviders() { 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 @@ void createWhenUsingProvidersShouldUseProviders() { @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 f4138baa1819..cf7c02fdbe8a 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 a49c95a6f4a0..ff13a15f22b2 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 @@ void ofWithCollectionCreatesComposite() { 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 @@ void ofWithArrayCreatesComposite() { 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 6fef92dd72f5..8eec73005f87 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 5b7a014bd115..c4d129ce7be1 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 @@ void servletPathWhenDoesNotEndWithSlashHasValidMappingAndPrefix() { 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 89aed095a373..deb19e1a027a 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 @@ void customPathMustBeginWithASlash() { .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 c1450a1f46c3..4b94b53c729e 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 d4f197d00b02..1b78252d4145 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 b08ce3beff05..5d5c09ebf44c 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 d8d7d0c5b87f..866992a0e4b6 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 bf70e37d12a3..f78413dadf46 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 f4cae7d659a9..1313c456db58 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 899714d82a3e..20a547637094 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 @@ else if (child.isFile()) { } 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 ef29927d11f6..1954c8718cb7 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 35a950c6e3b1..876a5bb21798 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 FileSystemWatcher(boolean daemon, Duration pollInterval, Duration quietPe */ 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 FileSystemWatcher(boolean daemon, Duration pollInterval, Duration quietPe * @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 void addListener(FileChangeListener fileChangeListener) { * @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 void addSourceDirectories(Iterable directories) { * @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 786a14c42fff..61376ea76230 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 44bf7d24d58d..5f2fea3db0c0 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 351f56896658..f8a2fa7db1ef 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 c04366f8c6d8..6c3a3d49966c 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 3237ca00ba61..2bd1094ef323 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 9f3767ae6b94..c02b2dc77fe2 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 7580d03e7e57..16b1609060d5 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 @@ private void setEnabled(boolean enabled) { * @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 void addUrls(Collection urls) { * @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 46df7df0d325..39b44b8d233c 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 ClassLoaderFile(Kind kind, byte[] contents) { * @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 06e7d8f3f97b..3d0c0708d9f9 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 ClassLoaderFiles() { * @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 ClassLoaderFiles(ClassLoaderFiles classLoaderFiles) { * @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 void addFile(String name, ClassLoaderFile file) { * @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 94f1a10143fd..03599d099f8e 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 RestartClassLoader(ClassLoader parent, URL[] urls) { */ 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 e2cbaeeac5b8..5b2c99c5e1ea 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 HttpRestartServer(SourceDirectoryUrlFilter sourceDirectoryUrlFilter) { * @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 66100c1f3dff..d62dbf9d5e86 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 a88526fc8dcb..c3cc42b62d90 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 RestartServer(SourceDirectoryUrlFilter sourceDirectoryUrlFilter) { * @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 458a5826d517..56d713291e36 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 ee62e930858b..c4b78d9dda14 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 29ae6eed8b56..8f0d5c0324b4 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 877374e93dd3..dd883fa3b197 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 @@ void urlsMustNotBeNull() { 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 7a59b90c06db..dd827beea12d 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 @@ void typeMustNotBeNull() { 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 c4c52da7ceb6..96e3a721bb42 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 @@ void setup() throws Exception { @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 @@ void directoryMustNotBeFile() throws Exception { 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 @@ void notEqualsWhenAFileIsModified() throws Exception { @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 72705e1dd219..48588899f5aa 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 @@ void fileMustNotBeADirectory() { 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 612850f90f64..c8b1c08e7294 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 @@ void setup() { 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 @@ void cannotAddListenerToStartedListener() { @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 @@ void sourceDirectoryMustNotBeAFile() throws IOException { 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 d54764ffef8a..76dd1dc691fc 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 7b941938d183..bf8cb73e015b 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 @@ void setup() { @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 df10274811c1..e6a30590ca61 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 @@ void setup() { 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 5140994e328f..0a474a6272ec 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 @@ void setup() { @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 b684e14178b2..a3bb24216c8c 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 @@ void setup() { @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 45be879837c3..2178e6b00aa3 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 1a234cad6ef5..b4c0a4f5df9c 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 @@ void setup() { @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 7febedbb1777..cc4f675b5c7b 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 758c3f95c7ef..5ea21115cbec 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 @@ void setup() throws Exception { @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 ed1dd1bb3a17..f325edd88fe4 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 @@ void getOrAddAttributeWithNewAttribute() { @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 @@ void addUrls() throws Exception { @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 db89e0b2d77d..286781ae4876 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 a965dcefeace..c3903bcec956 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 @@ void getSize() { @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 40f9fcc3ac12..612686599a08 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 @@ private File createSampleJarFile(File tempDir) throws IOException { @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 8d0ec158fcf1..905d51868314 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 1d8842812e1f..2c100127d42d 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 @@ void setup() { @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 1305a65d480d..728d32a3b90f 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 37382a7fbb48..41c099cfb110 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 static DockerComposeFile find(File workingDirectory) { * @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 static DockerComposeFile of(File file) { * @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 931ce4d2272c..5f0aee3b31d1 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 @@ static String parseDomain(String value) { } 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 33c0ba873102..32d1eba4458e 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 @@ private String buildString(String name, String tag, String digest) { * @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 static ImageReference of(String value) { } } 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 1990f9b27134..3a32f79a3882 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 302a3ba35817..0224c443cc71 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 @@ protected static class DockerComposeConnectionDetails implements ConnectionDetai * @param runningService the source {@link RunningService} */ protected DockerComposeConnectionDetails(RunningService runningService) { - Assert.notNull(runningService, "RunningService must not be null"); + Assert.notNull(runningService, "'runningService' must not be null"); this.origin = Origin.from(runningService); } diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/jdbc/JdbcUrlBuilder.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/jdbc/JdbcUrlBuilder.java index da4815943c4a..078ace52e966 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/jdbc/JdbcUrlBuilder.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/jdbc/JdbcUrlBuilder.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 @@ public class JdbcUrlBuilder { * @param containerPort the source container port */ public JdbcUrlBuilder(String driverProtocol, int containerPort) { - Assert.notNull(driverProtocol, "DriverProtocol must not be null"); + Assert.notNull(driverProtocol, "'driverProtocol' must not be null"); this.driverProtocol = driverProtocol; this.containerPort = containerPort; } @@ -67,7 +67,7 @@ public String build(RunningService service, String database) { } private String urlFor(RunningService service, String database) { - Assert.notNull(service, "Service must not be null"); + Assert.notNull(service, "'service' must not be null"); StringBuilder url = new StringBuilder("jdbc:%s://%s:%d".formatted(this.driverProtocol, service.host(), service.ports().get(this.containerPort))); if (StringUtils.hasLength(database)) { diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/r2dbc/ConnectionFactoryOptionsBuilder.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/r2dbc/ConnectionFactoryOptionsBuilder.java index 3157443079eb..42c0ded490a5 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/r2dbc/ConnectionFactoryOptionsBuilder.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/r2dbc/ConnectionFactoryOptionsBuilder.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,14 +51,14 @@ public class ConnectionFactoryOptionsBuilder { * @param containerPort the source container port */ public ConnectionFactoryOptionsBuilder(String driver, int containerPort) { - Assert.notNull(driver, "Driver must not be null"); + Assert.notNull(driver, "'driver' must not be null"); this.driver = driver; this.sourcePort = containerPort; } public ConnectionFactoryOptions build(RunningService service, String database, String user, String password) { - Assert.notNull(service, "Service must not be null"); - Assert.notNull(database, "Database must not be null"); + Assert.notNull(service, "'service' must not be null"); + Assert.notNull(database, "'database' must not be null"); ConnectionFactoryOptions.Builder builder = ConnectionFactoryOptions.builder() .option(ConnectionFactoryOptions.DRIVER, this.driver) .option(ConnectionFactoryOptions.HOST, service.host()) @@ -91,7 +91,7 @@ private Map parseParameters(String parameters) { Map 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 dfd998337963..114dce29cd6b 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 @@ void ofWithMultipleFilesReturnsDockerComposeFile() throws Exception { @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 76f7fb3228e3..ea40164be052 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 @@ void ofWhenLegacyDomainUsesNewDomain() { @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 @@ void ofWhenNameIncludesTagThrowsException() { 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 e9eb9045819f..caff7a7092b2 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 @@ void ofWhenHasIllegalCharacterThrowsException() { 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 @@ void ofWhenHasIllegalCharacterThrowsException() { 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 bb0589a16ae1..f2cc0cc09c86 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 @@ protected void appendParameters(StringBuilder url, String parameters) { @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 91fd383c3687..0e75c4f90f30 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 @@ void buildWhenHasParamsLabelBuildsOptions() { @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 f2ef2cfbb54d..ea5fde11f220 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 void postProcessEnvironment(ConfigurableEnvironment environment, SpringAp } 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 8626043851c8..d9a1bd2d4dc3 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 @@ private TypeFilter createTypeFilter(FilterType filterType, Class filterClass) 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 36b2698ec046..10b099f61edb 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 void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) t 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 bd9c22d2203a..3e24d6579dae 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 693a5431d03c..6df4c1338926 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 8ec9c28b7d28..fb8e9a749ff0 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 @@ void setup() { @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 9fdf7803b203..e0cc152ac4b6 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 AnnotatedClassFinder(Class annotationType) { * 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 Class findFromClass(Class source) { * 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 02fa5109d8bf..44d0dc491f76 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 ApplicationContextAssert hasSingleBean(Class type) { * 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 ApplicationContextAssert doesNotHaveBean(Class type) { * 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 AbstractObjectAssert getBean(Class type) { * 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 MapAssert getBeans(Class type) { * @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 8542c5aa675c..f6219e83efba 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 @@ static , C extends ApplicationCont 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 5bb815e9a48c..0c5cbac32a11 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 @@ protected AbstractApplicationContextRunner(Function, SELF */ protected AbstractApplicationContextRunner(RunnerConfiguration 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 SELF withAllowCircularReferences(boolean allowCircularReferences) { * @return a new instance with the updated initializers */ public SELF withInitializer(ApplicationContextInitializer 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 SELF withUserConfiguration(Class... configurationClasses) { * @return a new instance with the updated configuration */ public SELF withConfiguration(Configurations configurations) { - Assert.notNull(configurations, "Configurations must not be null"); + Assert.notNull(configurations, "'configurations' must not be null"); return newInstance(this.runnerConfiguration.withConfiguration(configurations)); } @@ -559,7 +559,7 @@ private RunnerConfiguration withAllowCircularReferences(boolean allowCircular } private RunnerConfiguration 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 @@ private RunnerConfiguration withBean(String name, Class type, Supplier } private RunnerConfiguration 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 8c80978726c8..c11829effa1c 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 ae9066273f0e..4eb2f11204e3 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 @@ protected 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 @@ protected final Class getResourceLoadClass() { */ 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 T parseObject(byte[] jsonBytes) throws IOException { */ 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 T parseObject(String jsonString) throws IOException { */ 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 T readObject(String resourcePath) throws IOException { */ 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 T readObject(File file) throws IOException { */ 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 T readObject(InputStream inputStream) throws IOException { */ 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 T readObject(Resource resource) throws IOException { */ 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 T readObject(Reader reader) throws IOException { */ 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 @@ protected abstract static class FieldInitializer { @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 9b9bf84b3af1..71f6dea0b3f0 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 BasicJsonTester(Class resourceLoadClass) { * @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 797c98918c88..d8f7522eb82f 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 @@ protected GsonTester(Gson gson) { */ 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 97d58ff8ec42..3fb169b4ca8b 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 JacksonTester(Class resourceLoadClass, ResolvableType type, ObjectMapp 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 94169a62e854..98ff2675af6c 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 JsonContent(Class resourceLoadClass, ResolvableType type, String json) * @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 797abc24de5f..17d6c5ccfb2b 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 @@ private class JsonPathValue { JsonPathValue(CharSequence expression, Object... args) { org.springframework.util.Assert.hasText((expression != null) ? expression.toString() : null, - "expression must not be null or empty"); + "'expression' must not be empty"); this.expression = String.format(expression.toString(), args); this.jsonPath = JsonPath.compile(this.expression); } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java index 988e5d30329f..4a6a56d67f0a 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonbTester.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 JsonbTester 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 @@ protected JsonbTester(Jsonb jsonb) { */ 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 8535b82b0198..85e9e0753907 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 d4e77598801e..9249dc6616cd 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 static MockSettings withSettings(MockReset reset) { * @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 cb5774d092d7..12a96f6a4d37 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 void setBeanClassLoader(ClassLoader classLoader) { @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 5a9bb64f5b3e..92e963cb3937 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 @@ T createSpy(Object instance) { @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 3a516ebe40b3..6d1e50e14e36 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 void applyTo(ConfigurableEnvironment environment, Type type) { * @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 static final class Pair { 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 void close() { } 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 035779d2ec8c..41ab878c721f 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 LocalHostUriTemplateHandler(Environment environment, String scheme) { */ 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 7c98aa76dc9d..fef4c1af0697 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 MockServerRestClientCustomizer() { */ 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 MockServerRestClientCustomizer(Class * @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 3cd206bc1a79..985fce7ce1be 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 MockServerRestTemplateCustomizer() { */ 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 MockServerRestTemplateCustomizer(Class 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 6905c74e835f..5912cb6f223c 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 static MockRestServiceServer bindTo(RestTemplate restTemplate, */ 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 c715b79fcd94..55130cba1700 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 @@ private TestRestTemplate(RestTemplateBuilder builder, UriTemplateHandler uriTemp 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 47c46b477f45..dbc2cd2d35f7 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 60d0f7776d51..a2d7d6555c28 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 e0da18ec1262..0d760525d9d7 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 8547e0f2ca34..d4455c55a44c 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 @@ void setup() { 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 @@ void getWhenContextTypeIsNullShouldThrowException() { 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 @@ void getWhenContextTypeIsClassShouldThrowException() { 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 @@ void getWhenSupplierIsNullShouldThrowException() { 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 1990c5c63389..68beabe910fe 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 @@ void cleanup() { @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 370e9d72f85a..36153bc05a72 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 @@ void andThenWithNull() { 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 f680b5f78a33..ba54bc5e3192 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 @@ void writeMapShouldReturnJsonContent() throws Exception { 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 50602dd5c7fa..205aebe9ee7a 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 62fe8f3df959..ea1927753258 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 366ba5ae7bde..7be1e0964ad9 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 1c3b27265e8d..a9e8b456aed7 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 @@ void createWhenJsonIsNullShouldThrowException() { 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 524196cea30b..9e77a73a3fce 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 8d83219da636..ce34a9b3fba6 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 f349e9e8a46e..8c9483c3479f 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 8f5cea4d6f08..660ceb107bd6 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 @@ void createSpy() { 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 48b63138376a..57370a9df58b 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 0dffb76514a8..82469c395fea 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 @@ void createShouldUseSimpleRequestExpectationManager() { 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 @@ void createWhenExpectationManagerSupplierIsNullShouldThrowException() { 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 8f08c63abc94..c6787d202c72 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 @@ void createShouldUseSimpleRequestExpectationManager() { 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 @@ void createWhenExpectationManagerSupplierIsNullShouldThrowException() { 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 a818798407fe..69b704761127 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 @@ void setup() { @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 c3299a417515..84e0ff4f2980 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 9b159132054f..21e787a83c03 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 @@ void createWithCapabilitiesWhenEnvironmentIsNullWillThrowException() { 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 f9a5730242d6..0f556e50415d 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 @@ private TestcontainersPropertySource(Map> valueSupplier 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 14518b982d8b..ccf6bedd7428 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 @@ protected ContainerConnectionDetailsFactory(String connectionName, String... req * @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 @@ protected static class ContainerConnectionDetails> * @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 3205aa4eb9f6..2bccf69beb14 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 d3b89a8d6145..c0e0a69ded27 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 a027d7237cd0..077cd9eb7b19 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 @@ public String toString() { * @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 f17e717249fd..2011bf6a9a8d 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 BuildRequest withRunImage(ImageReference runImageName) { * @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 BuildRequest withCreator(Creator creator) { * @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 BuildRequest withEnv(String name, String value) { * @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 BuildRequest withPublish(boolean publish) { * @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 BuildRequest withBuildpacks(BuildpackReference... buildpacks) { * @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 BuildRequest withBuildpacks(List buildpacks) { * @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 BuildRequest withBindings(Binding... bindings) { * @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 BuildRequest withNetwork(String network) { * @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 BuildRequest withTags(ImageReference... tags) { * @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 BuildRequest withTags(List tags) { * @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 BuildRequest withBuildWorkspace(Cache buildWorkspace) { * @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 BuildRequest withBuildCache(Cache buildCache) { * @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 BuildRequest withLaunchCache(Cache launchCache) { * @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 @@ private Instant parseCreatedDate(String createdDate) { * @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 BuildRequest withApplicationDirectory(String applicationDirectory) { * @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 BuildRequest withSecurityOptions(List securityOptions) { * @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 static BuildRequest of(ImageReference name, Function a } 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 09baf1db3292..72234aa5a1c2 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 Builder(BuildLog log, DockerConfiguration dockerConfiguration) { } 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 @@ private class ImageFetcher { } 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 3b566cbf0fb0..2d5a54bb631e 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 @@ void attachTo(ImageConfig.Update update) { * @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 @@ static BuilderMetadata fromImage(Image image) throws IOException { * @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 093c93bc8ba6..ac9f54591e9c 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 @@ BuildpackLayerDetails getBuildpack(String id, String version) { * @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 @@ static BuildpackLayersMetadata fromImage(Image image) throws IOException { * @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 f6d6b77213f0..79063567f0e6 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 @@ String getHomepage() { * @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 @@ static BuildpackMetadata fromImage(Image image) throws IOException { * @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 ebbf7da13277..a555672b9c59 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 String toString() { * @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 1883df4264cd..ec64d0a9b590 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 @@ private static List getResolvers() { * @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 @@ static Buildpacks resolveAll(BuildpackResolverContext context, Collection "'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 327ca42fadac..6ed3903e7fb7 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 @@ public String toString() { * @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 @@ private static StackId fromImageConfig(ImageConfig imageConfig) { * @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 e5659f9bce4c..6e89da9717be 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 Image pull(ImageReference reference, ImagePlatform platform, */ 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 Image pull(ImageReference reference, ImagePlatform platform, */ 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 void push(ImageReference reference, UpdateListener * @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 void load(ImageArchive archive, UpdateListener list */ @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 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"); 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 void exportLayers(ImageReference reference, IOBiConsumer params = force ? FORCE_PARAMS : Collections.emptySet(); URI uri = buildUrl("/images/" + reference, params); http().delete(uri).close(); @@ -364,7 +364,7 @@ public Image inspect(ImageReference reference) throws IOException { } 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 @@ private Image inspect(ApiVersion apiVersion, ImageReference reference) throws IO } 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 ContainerApi { */ 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 @@ private void uploadContainerContent(ContainerReference reference, ContainerConte * @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 void start(ContainerReference reference) throws IOException { * @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 void logs(ContainerReference reference, UpdateListener li * @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 ContainerStatus wait(ContainerReference reference) throws IOException { * @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 VolumeApi { * @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 e14b5d661db2..4e624d5d9ec3 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 fa47c349fbd1..9a650d42bdac 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 DockerRegistryAuthentication getPublishRegistryAuthentication() { } 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 DockerConfiguration withBuilderRegistryTokenAuthentication(String token) 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 ec22850faa17..955c5fde151b 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 DockerConnectionException(String host, Exception cause) { } 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 e521f4a8afa4..d25698186863 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 Message getResponseMessage() { 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 718912e2a38e..502b710820e2 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 662680f4bd42..b7316bc62a0f 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 String toString() { * @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 7d08240af857..caa3f1501e71 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 @@ private List getParts() { * @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 static Binding of(String value) { * @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 static Binding from(VolumeName sourceVolume, String destination) { * @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 1ee0e19ae6f3..c13e737ad819 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 String toString() { * @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 c0f5dd217d49..5a9b04b20767 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 @@ static ContainerContent of(TarArchive archive) { * @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 f5a5c6ac5a39..a26d43feaadd 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 8d8145ac4113..81b4565f72de 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 void withUpdatedConfig(Consumer update) { * @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 void withNewLayer(Layer layer) { * @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 void withCreateDate(Instant createDate) { * @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 073871c39692..fa9a85c4ad72 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 @@ private String getNameWithDefaultPath(String domain, String name) { * @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 d43570c117f9..4b6ce2bc8928 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 String toString() { * @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 c3c263e89bf8..7bf34f67bd9d 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 ImageReference inTaggedOrDigestForm() { * @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 static ImageReference random(String prefix, int randomLength) { * @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 static ImageReference of(String value) { 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 6d481eb12d7f..78671a1faaa6 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 void writeTo(OutputStream outputStream) throws IOException { * @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 static Layer of(IOConsumer layout) throws IOException { * @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 d30cc6a331aa..adc0d27f2856 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 String toString() { * @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 static LayerId of(String value) { * @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 d9696d3db7f3..3cf51ae9fca1 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 @@ private 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 7ea8a18a1cb4..d3619ddd8ba2 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 static VolumeName basedOn(S source, String prefix, String suffix, int */ 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 @@ private static String getDigest(String name, int length) { 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 @@ private static String asHexString(byte[] digest, int digestLength) { * @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 911df2ad4927..367dd9b4276f 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 @@ static Content of(String string) { * @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 @@ static Content of(byte[] bytes) { * @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 @@ static Content of(File file) { * @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 7f63c012d82e..831de4819e24 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 @@ private 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 static int umaskForPath(Path path) throws IOException { * @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 1f42a68d3f0c..6b9b9d0e3703 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 @@ else if (this.content instanceof File file) { * @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 static InspectedContent of(InputStream inputStream, Inspector... inspecto * @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 static InspectedContent of(Content content, Inspector... inspectors) thro * @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 dcbb3229b927..c1d3b100211e 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 c16232cfa9d1..4d04bdb22f4a 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 @@ void fromEnvReturnsOwner() { @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 2d5490f7285a..2bf5de0ea211 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 @@ void forJarFileWithNameReturnsRequest() throws IOException { @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 @@ void withEnvMapAddsEnvEntries() throws IOException { 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 @@ void withBuildpacksAddsBuildpacks() throws IOException { 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 @@ void withBindingsAddsBindings() throws IOException { 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 @@ void withTagsAddsTags() throws IOException { 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 @@ void withBuildBindCacheAddsCache() throws IOException { 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 @@ void withLaunchBindCacheAddsCache() throws IOException { 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 292df537fdc7..5e760f873611 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 @@ void fromImageWithoutStackLoadsMetadata() throws IOException { @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 22c7b57e2ab0..ba440ade8c4b 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 @@ void createWithDockerConfiguration() { 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 83fdc1122632..6b53ff175624 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 @@ void fromImageLoadsMetadata() throws IOException { @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 6ca36bcdd1f3..5916796df6dd 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 @@ void fromImageLoadsMetadata() throws IOException { @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 9fc08f4a13b6..b81b9c2cc625 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 2c91342e3516..78dba090070c 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 @@ void resolveWhenFullyQualifiedReferenceWithInvalidImageReferenceThrowsException( 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 4bd256bb7506..869fcfbfc08b 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 a804b596a317..70f075b8cd22 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 2f717e44b620..01c406b4a688 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 @@ void setup() { @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 @@ void pullWithPlatformAndInsufficientApiVersionThrowsException() throws Exception @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 @@ void pushWithErrorInStreamThrowsException() throws Exception { @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 @@ void loadLoadsImage() throws Exception { @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 @@ void removeWhenForceIsTrueRemovesContainer() throws Exception { @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 @@ void inspectInspectImage() throws Exception { @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 @@ void exportLayersWhenReferenceIsNullThrowsException() { 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 @@ void exportLayersWithNoManifestThrowsException() throws Exception { 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 @@ void setup() { @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 @@ void createWithPlatformAndKnownInsufficientApiVersionThrowsException() throws Ex @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 @@ void startStartsContainer() throws Exception { @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 @@ void logsProducesEvents() throws Exception { @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 @@ void waitReturnsStatus() throws Exception { @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 @@ void setup() { @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 02f736671388..202eb2edaa38 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 @@ void create() { @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 68c5546e1a98..48c73b22ba72 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 72c3ff03213f..87cadc062bbe 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 d06d315eebf8..f3339d6cf7b6 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 7f8d29c269f5..ebd7e1c3de03 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 @@ void ofReturnsValue() { @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 @@ void fromReturnsValue() { @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 @@ void fromVolumeNameSourceReturnsValue() { @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 ce174809f0a7..c59f70926201 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 e6027da59244..285ec9b7e148 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 41d47672348b..e6aa88b6eded 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 @@ void ofCreatesInstance() { @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 717d165d406d..43c4aacc8d1d 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 @@ void ofWhenLegacyDomainUsesNewDomain() { @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 @@ void ofWhenNameIncludesTagThrowsException() { 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 46da80ad2399..b452f4cd95c3 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 @@ void ofWithOsAndArchitectureAndVariantParses() { @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 b22c27e1ba2c..04e7b92f2d18 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 @@ void ofWhenHasIllegalCharacterThrowsException() { 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 @@ void ofWhenContainsUpperCaseThrowsException() { 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 @@ void ofWhenContainsUpperCaseThrowsException() { 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 @@ void randomWithLengthGeneratesRandomName() { @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 d910d0f8f93e..3317665b8937 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 @@ void hashCodeAndEquals() { @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 @@ void ofSha256DigestWithZeroPadding() { @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 bad2124fb8d5..1d46b6fedffd 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 aa9284485d92..63d3c4e295cb 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 90bafa796e56..45694928cc70 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 @@ void randomStringWithLengthGeneratesRandomString() { @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 @@ void basedOnGeneratesHashBasedName() { @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 cb9a8eb1f20a..bb2c5180d9dc 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 @@ 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 @@ void ofWhenStreamReturnsWritable() throws Exception { @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 @@ void ofWhenStringReturnsWritable() throws Exception { @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 dfbf2483ba0f..f38ec190727a 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 48c2f6f70e11..58b49b645f26 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 @@ void createWhenOwnerIsNullThrowsException() throws Exception { 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 3360b402d9ef..4a79dc08ec81 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 String getName() { * @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 void addCommands(Iterable commands) { * @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 void addCommand(Command command) { * @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 void setOptionCommands(Class... commandClasses) { * @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 a8d01cf1865c..1d0dc3824f76 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 @@ void failsWithInvalidImageName() throws IOException { 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 @@ void failsWithInvalidTag() throws IOException { 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 2d12921fa055..f95d895909ec 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 @@ void setClassifier(String classifier) { 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 db52cea7ff0e..4e0004fff39f 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 @@ void load() { } 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 8298411e5631..f84eaa92d3fe 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 eec1b2a714cd..73301dec307f 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 void registerIfAbsent(Class type, InstanceSupplier instanceSupp } 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 613143a09b62..edbccab0978a 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 99e79a4af4f8..4e38a508b629 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 4a673a378211..9fff7198ca9c 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 SpringApplication(Class... primarySources) { @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 WebApplicationType getWebApplicationType() { * @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 void setAddConversionService(boolean addConversionService) { * @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 Set getSources() { * @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 Set getAllSources() { * @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 static void main(String[] args) throws Exception { * @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 static int exit(ApplicationContext context, ExitCodeGenerator... exitCode * @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 433087a1bed9..1347bb80f9fa 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 @@ private final class Handlers implements SpringApplicationShutdownHandlers, Runna @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 @@ public void add(Runnable action) { @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 b3d40bd8085b..35bb085afe3c 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 71ebfd98353f..ac7f33a84f99 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 SpringApplicationAdminMXBeanRegistrar(String name) throws MalformedObject @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 2b926383f803..50e30b7cab09 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 b0c815168f4a..96a303335295 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 e88e18ea0054..53f1f2c93a6e 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 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 19250603a297..49a416784634 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 @@ private Class getStateType() { * @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 static void publish(ApplicationContext cont */ 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 235027a9ecc9..5e5267b4219f 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 ApplicationPidFileWriter(String filename) { * @param file the file containing pid */ public ApplicationPidFileWriter(File file) { - Assert.notNull(file, "File must not be null"); + Assert.notNull(file, "'file' must not be null"); this.file = file; } @@ -128,7 +128,7 @@ public ApplicationPidFileWriter(File file) { * @param triggerEventType the trigger event type */ public void setTriggerEventType(Class 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 744c04d3f4a4..40fccce0d333 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 @@ protected Configurations(Collection> classes) { */ 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 9482c48afe13..31dde9c83ea2 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 ConfigData(Collection> propertySources, Optio */ 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 @@ private Options copy(Consumer> processor) { * @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 62bd68dc528b..33f21c68caf9 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 ConfigDataLocationNotFoundException(ConfigDataLocation location, Throwabl */ 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 0b7d8990a4bd..439a0231d1b9 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 ConfigDataResourceNotFoundException(ConfigDataResource resource, Throwabl 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 b0977f9c0858..f842d1cedfde 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 aac0897413eb..f85e56eccc79 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 416c77664834..16d29352c224 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 static BoundConfigurationProperties get(ApplicationContext context) { } 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 35a7a71552b7..e0f1118e2df7 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 Bindable asBindTarget() { * @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 c80c0526e528..34177a1c581e 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 @@ private void bind(ConfigurationPropertiesBean bean) { * @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 87c03f77d3a6..9c5715394432 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 @@ private Source whenNonNull(Source source) { * @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 PropertyMapper alwaysApplying(SourceOperator operator) { * @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 static final class Source { 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 Source asInt(Function adapter) { * @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 Source whenInstanceOf(Class target) { * @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 Source whenNot(Predicate predicate) { * @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 Source when(Predicate predicate) { * 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 void to(Consumer consumer) { * @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 R to(R instance, BiFunction mapper) { * @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 R toInstance(Function factory) { * @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 7c0fd742fd8a..a0d102ff0983 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 AbstractBindHandler() { * @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 2cc12866590a..d33010d79887 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 boolean isBound() { * @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 void ifBound(Consumer consumer) { * 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 9e76a84e82c1..6b5d6f558e2e 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 Bindable withAnnotations(Annotation... annotations) { 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 Bindable withBindMethod(BindMethod bindMethod) { */ @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 static Bindable ofInstance(T instance) { * @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 static Bindable> mapOf(Class keyType, Class valueT * @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 6f70266024ad..bb4232282223 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 void registerHints(RuntimeHints hints) { * @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 static BindableRuntimeHintsRegistrar forTypes(Class... types) { * @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 1630d2d8997a..a4d7e2537197 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 Binder(Iterable sources, PlaceholdersResolve 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 T bindOrCreate(ConfigurationPropertyName name, Bindable target, Bi } 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 f2a136be1d81..1b86b34d0ba2 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 67e432fab521..7bf6807ef3d2 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 @@ protected String resolvePlaceholder(String placeholder) { } 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 b1be6d24c85d..d674cc08c257 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 1dd1d5784655..390894989fbe 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 6c48ed3b43f0..33e89baab2cb 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 @@ public ConfigurationProperty getConfigurationProperty(ConfigurationPropertyName @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 27f4948e1a12..4fa1d275bef8 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 ConfigurationProperty(ConfigurationPropertyName name, Object value, Origi private ConfigurationProperty(ConfigurationPropertySource source, ConfigurationPropertyName name, Object value, Origin origin) { - Assert.notNull(name, "Name must not be null"); - Assert.notNull(value, "Value must not be null"); + Assert.notNull(name, "'name' must not be null"); + Assert.notNull(value, "'value' must not be null"); this.source = source; this.name = name; this.value = value; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyCaching.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyCaching.java index 4471b9dea475..e464a9f0b30b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyCaching.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyCaching.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. @@ -92,7 +92,7 @@ static ConfigurationPropertyCaching get(Iterable so * @return a caching instance that controls the matching source */ static ConfigurationPropertyCaching get(Iterable 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 5a077ad00a19..d44ab92475ff 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 ConfigurationPropertyNameAliases(ConfigurationPropertyName name, Configur } public void addAliases(String name, String... aliases) { - Assert.notNull(name, "Name must not be null"); - Assert.notNull(aliases, "Aliases must not be null"); + Assert.notNull(name, "'name' must not be null"); + Assert.notNull(aliases, "'aliases' must not be null"); addAliases(ConfigurationPropertyName.of(name), Arrays.stream(aliases).map(ConfigurationPropertyName::of).toArray(ConfigurationPropertyName[]::new)); } public void addAliases(ConfigurationPropertyName name, ConfigurationPropertyName... aliases) { - Assert.notNull(name, "Name must not be null"); - Assert.notNull(aliases, "Aliases must not be null"); + Assert.notNull(name, "'name' must not be null"); + Assert.notNull(aliases, "'aliases' must not be null"); this.aliases.addAll(name, Arrays.asList(aliases)); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyState.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyState.java index 1b88a9a6e1ff..4bb7b2c5241f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyState.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyState.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. @@ -56,8 +56,8 @@ public enum ConfigurationPropertyState { * {@link #ABSENT}. */ static 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 86a266f01335..92f72918f97f 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 1bef986b34ef..60470e3798a0 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 InvalidConfigurationPropertyValueException(String name, Object value, Str 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 b24f13fa94fa..ae7e1c89e098 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 MapConfigurationPropertySource(Map map) { * @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 b0fa0a3e8167..cc868e6759bb 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 @@ private static Set asSet(Collection collection) { 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 7e2066258240..34192c1216ec 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 965b2ed14ab9..c13d3c56b866 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 @@ public String toString() { * {@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 b3d608d935ed..4fe4a5625f03 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 e2b4237924ba..4ece3986fe8d 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 7f5281a28f9a..d9b1f2e29b37 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 61833f0c97c8..46aabde4e88b 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 static Duration detectAndParse(String value, ChronoUnit unit) { * @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 cc5319c4ac1d..820d7e360b18 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 static Period detectAndParse(String value, ChronoUnit unit) { * @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 521b275a0985..37526035693e 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 ConfigTreePropertySource(String name, Path sourceDirectory, Option... opt private ConfigTreePropertySource(String name, Path sourceDirectory, Set