Merge pull request #44044 from izeye
* pr/44044: Use consistent exception messages in Assert calls Closes gh-44044
This commit is contained in:
@@ -37,7 +37,7 @@ public class MongoHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
public MongoHealthIndicator(MongoTemplate mongoTemplate) {
|
||||
super("MongoDB health check failed");
|
||||
Assert.notNull(mongoTemplate, "MongoTemplate must not be null");
|
||||
Assert.notNull(mongoTemplate, "'mongoTemplate' must not be null");
|
||||
this.mongoTemplate = mongoTemplate;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ public class JmxEndpointExporter implements InitializingBean, DisposableBean, Be
|
||||
}
|
||||
|
||||
private ObjectName register(ExposableJmxEndpoint endpoint) {
|
||||
Assert.notNull(endpoint, "Endpoint must not be null");
|
||||
Assert.notNull(endpoint, "'endpoint' must not be null");
|
||||
try {
|
||||
ObjectName name = this.objectNameFactory.getObjectName(endpoint);
|
||||
EndpointMBean mbean = new EndpointMBean(this.responseMapper, this.classLoader, endpoint);
|
||||
|
||||
@@ -81,8 +81,8 @@ public class DefaultErrorViewResolver implements ErrorViewResolver, Ordered {
|
||||
* @since 2.4.0
|
||||
*/
|
||||
public DefaultErrorViewResolver(ApplicationContext applicationContext, Resources resources) {
|
||||
Assert.notNull(applicationContext, "ApplicationContext must not be null");
|
||||
Assert.notNull(resources, "Resources must not be null");
|
||||
Assert.notNull(applicationContext, "'applicationContext' must not be null");
|
||||
Assert.notNull(resources, "'resources' must not be null");
|
||||
this.applicationContext = applicationContext;
|
||||
this.resources = resources;
|
||||
this.templateAvailabilityProviders = new TemplateAvailabilityProviders(applicationContext);
|
||||
|
||||
@@ -574,7 +574,7 @@ class QuartzAutoConfigurationTests {
|
||||
static class ComponentThatUsesScheduler {
|
||||
|
||||
ComponentThatUsesScheduler(Scheduler scheduler) {
|
||||
Assert.notNull(scheduler, "Scheduler must not be null");
|
||||
Assert.notNull(scheduler, "'scheduler' must not be null");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class SessionAutoConfigurationEarlyInitializationIntegrationTests {
|
||||
|
||||
@Bean
|
||||
MapSessionRepository mapSessionRepository(ConfigurableApplicationContext context) {
|
||||
Assert.isTrue(context.getBeanFactory().isConfigurationFrozen(), "Context should be frozen");
|
||||
Assert.isTrue(context.getBeanFactory().isConfigurationFrozen(), "'context' should be frozen");
|
||||
return new MapSessionRepository(new LinkedHashMap<>());
|
||||
}
|
||||
|
||||
|
||||
@@ -83,14 +83,14 @@ class DefaultErrorViewResolverTests {
|
||||
@Test
|
||||
void createWhenApplicationContextIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new DefaultErrorViewResolver(null, new Resources()))
|
||||
.withMessageContaining("ApplicationContext must not be null");
|
||||
.withMessageContaining("'applicationContext' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenResourcePropertiesIsNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new DefaultErrorViewResolver(mock(ApplicationContext.class), (Resources) null))
|
||||
.withMessageContaining("Resources must not be null");
|
||||
.withMessageContaining("'resources' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -47,7 +47,7 @@ public class HttpStatusHandler implements Handler {
|
||||
* @param status the status
|
||||
*/
|
||||
public HttpStatusHandler(HttpStatus status) {
|
||||
Assert.notNull(status, "Status must not be null");
|
||||
Assert.notNull(status, "'status' must not be null");
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class HttpStatusHandlerTests {
|
||||
@Test
|
||||
void statusMustNotBeNull() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new HttpStatusHandler(null))
|
||||
.withMessageContaining("Status must not be null");
|
||||
.withMessageContaining("'status' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -44,7 +44,7 @@ public class SpringBootMockResolver implements MockResolver {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T> T getUltimateTargetObject(Object candidate) {
|
||||
Assert.notNull(candidate, "Candidate must not be null");
|
||||
Assert.notNull(candidate, "'candidate' must not be null");
|
||||
try {
|
||||
if (AopUtils.isAopProxy(candidate) && candidate instanceof Advised advised) {
|
||||
TargetSource targetSource = advised.getTargetSource();
|
||||
|
||||
@@ -42,7 +42,7 @@ final class BuildpackCoordinates {
|
||||
private final String version;
|
||||
|
||||
private BuildpackCoordinates(String id, String version) {
|
||||
Assert.hasText(id, "ID must not be empty");
|
||||
Assert.hasText(id, "'id' must not be empty");
|
||||
this.id = id;
|
||||
this.version = version;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ final class BuildpackCoordinates {
|
||||
* @return a new {@link BuildpackCoordinates} instance
|
||||
*/
|
||||
static BuildpackCoordinates fromBuildpackMetadata(BuildpackMetadata buildpackMetadata) {
|
||||
Assert.notNull(buildpackMetadata, "BuildpackMetadata must not be null");
|
||||
Assert.notNull(buildpackMetadata, "'buildpackMetadata' must not be null");
|
||||
return new BuildpackCoordinates(buildpackMetadata.getId(), buildpackMetadata.getVersion());
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public final class DockerConfiguration {
|
||||
}
|
||||
|
||||
public DockerConfiguration withBuilderRegistryTokenAuthentication(String token) {
|
||||
Assert.notNull(token, "Token must not be null");
|
||||
Assert.notNull(token, "'token' must not be null");
|
||||
return new DockerConfiguration(this.host, new DockerRegistryTokenAuthentication(token),
|
||||
this.publishAuthentication, this.bindHostToBuilder);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class BuildpackCoordinatesTests extends AbstractJsonTests {
|
||||
@Test
|
||||
void fromBuildpackMetadataWhenMetadataIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> BuildpackCoordinates.fromBuildpackMetadata(null))
|
||||
.withMessage("BuildpackMetadata must not be null");
|
||||
.withMessage("'buildpackMetadata' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -113,7 +113,7 @@ class BuildpackCoordinatesTests extends AbstractJsonTests {
|
||||
@Test
|
||||
void ofWhenIdIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> BuildpackCoordinates.of(null, null))
|
||||
.withMessage("ID must not be empty");
|
||||
.withMessage("'id' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Layer {
|
||||
* @param name the name of the layer.
|
||||
*/
|
||||
public Layer(String name) {
|
||||
Assert.hasText(name, "Name must not be empty");
|
||||
Assert.hasText(name, "'name' must not be empty");
|
||||
Assert.isTrue(PATTERN.matcher(name).matches(), () -> "Malformed layer name '" + name + "'");
|
||||
Assert.isTrue(!name.equalsIgnoreCase("ext") && !name.toLowerCase(Locale.ROOT).startsWith("springboot"),
|
||||
() -> "Layer name '" + name + "' is reserved");
|
||||
|
||||
@@ -107,9 +107,9 @@ public abstract class Packager {
|
||||
* @param source the source archive file to package
|
||||
*/
|
||||
protected Packager(File source) {
|
||||
Assert.notNull(source, "Source file must not be null");
|
||||
Assert.notNull(source, "'source' file must not be null");
|
||||
Assert.isTrue(source.exists() && source.isFile(),
|
||||
() -> "Source must refer to an existing file, got " + source.getAbsolutePath());
|
||||
() -> "'source' must refer to an existing file, got " + source.getAbsolutePath());
|
||||
this.source = source.getAbsoluteFile();
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ public abstract class Packager {
|
||||
* @param layers the jar layers
|
||||
*/
|
||||
public void setLayers(Layers layers) {
|
||||
Assert.notNull(layers, "Layers must not be null");
|
||||
Assert.notNull(layers, "'layers' must not be null");
|
||||
this.layers = layers;
|
||||
this.layersIndex = new LayersIndex(layers);
|
||||
}
|
||||
@@ -204,7 +204,7 @@ public abstract class Packager {
|
||||
|
||||
protected final void write(JarFile sourceJar, Libraries libraries, AbstractJarWriter writer,
|
||||
boolean ensureReproducibleBuild) throws IOException {
|
||||
Assert.notNull(libraries, "Libraries must not be null");
|
||||
Assert.notNull(libraries, "'libraries' must not be null");
|
||||
write(sourceJar, writer, new PackagedLibraries(libraries, ensureReproducibleBuild));
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ApplicationContentFilter implements ContentFilter<String> {
|
||||
private final String pattern;
|
||||
|
||||
public ApplicationContentFilter(String pattern) {
|
||||
Assert.hasText(pattern, "Pattern must not be empty");
|
||||
Assert.hasText(pattern, "'pattern' must not be empty");
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ public class CustomLayers implements Layers {
|
||||
|
||||
public CustomLayers(List<Layer> layers, List<ContentSelector<String>> applicationSelectors,
|
||||
List<ContentSelector<Library>> librarySelectors) {
|
||||
Assert.notNull(layers, "Layers must not be null");
|
||||
Assert.notNull(applicationSelectors, "ApplicationSelectors must not be null");
|
||||
Assert.notNull(layers, "'layers' must not be null");
|
||||
Assert.notNull(applicationSelectors, "'applicationSelectors' must not be null");
|
||||
validateSelectorLayers(applicationSelectors, layers);
|
||||
Assert.notNull(librarySelectors, "LibrarySelectors must not be null");
|
||||
Assert.notNull(librarySelectors, "'librarySelectors' must not be null");
|
||||
validateSelectorLayers(librarySelectors, layers);
|
||||
this.layers = new ArrayList<>(layers);
|
||||
this.applicationSelectors = new ArrayList<>(applicationSelectors);
|
||||
|
||||
@@ -47,8 +47,8 @@ public class IncludeExcludeContentSelector<T> implements ContentSelector<T> {
|
||||
|
||||
public <S> IncludeExcludeContentSelector(Layer layer, List<S> includes, List<S> excludes,
|
||||
Function<S, ContentFilter<T>> filterFactory) {
|
||||
Assert.notNull(layer, "Layer must not be null");
|
||||
Assert.notNull(filterFactory, "FilterFactory must not be null");
|
||||
Assert.notNull(layer, "'layer' must not be null");
|
||||
Assert.notNull(filterFactory, "'filterFactory' must not be null");
|
||||
this.layer = layer;
|
||||
this.includes = (includes != null) ? adapt(includes, filterFactory) : Collections.emptyList();
|
||||
this.excludes = (excludes != null) ? adapt(excludes, filterFactory) : Collections.emptyList();
|
||||
|
||||
@@ -36,7 +36,7 @@ public class LibraryContentFilter implements ContentFilter<Library> {
|
||||
private final Pattern pattern;
|
||||
|
||||
public LibraryContentFilter(String coordinatesPattern) {
|
||||
Assert.hasText(coordinatesPattern, "CoordinatesPattern must not be empty");
|
||||
Assert.hasText(coordinatesPattern, "'coordinatesPattern' must not be empty");
|
||||
StringBuilder regex = new StringBuilder();
|
||||
for (int i = 0; i < coordinatesPattern.length(); i++) {
|
||||
char c = coordinatesPattern.charAt(i);
|
||||
|
||||
@@ -182,7 +182,7 @@ abstract class AbstractPackagerTests<P extends Packager> {
|
||||
this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class);
|
||||
P packager = createPackager();
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> execute(packager, null))
|
||||
.withMessageContaining("Libraries must not be null");
|
||||
.withMessageContaining("'libraries' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -31,12 +31,12 @@ class LayerTests {
|
||||
|
||||
@Test
|
||||
void createWhenNameIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new Layer(null)).withMessage("Name must not be empty");
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new Layer(null)).withMessage("'name' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenNameIsEmptyThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new Layer("")).withMessage("Name must not be empty");
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new Layer("")).withMessage("'name' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -33,13 +33,13 @@ class ApplicationContentFilterTests {
|
||||
@Test
|
||||
void createWhenPatternIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new ApplicationContentFilter(null))
|
||||
.withMessage("Pattern must not be empty");
|
||||
.withMessage("'pattern' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenPatternIsEmptyThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new ApplicationContentFilter(""))
|
||||
.withMessage("Pattern must not be empty");
|
||||
.withMessage("'pattern' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -42,14 +42,14 @@ class IncludeExcludeContentSelectorTests {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(
|
||||
() -> new IncludeExcludeContentSelector<>(null, Collections.emptyList(), Collections.emptyList()))
|
||||
.withMessage("Layer must not be null");
|
||||
.withMessage("'layer' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenFactoryIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> new IncludeExcludeContentSelector<>(LAYER, null, null, null))
|
||||
.withMessage("FilterFactory must not be null");
|
||||
.withMessage("'filterFactory' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -38,13 +38,13 @@ class LibraryContentFilterTests {
|
||||
@Test
|
||||
void createWhenCoordinatesPatternIsNullThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new LibraryContentFilter(null))
|
||||
.withMessage("CoordinatesPattern must not be empty");
|
||||
.withMessage("'coordinatesPattern' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
void createWhenCoordinatesPatternIsEmptyThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> new LibraryContentFilter(""))
|
||||
.withMessage("CoordinatesPattern must not be empty");
|
||||
.withMessage("'coordinatesPattern' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -121,7 +121,7 @@ public interface BootstrapRegistry {
|
||||
* @since 2.4.2
|
||||
*/
|
||||
default InstanceSupplier<T> withScope(Scope scope) {
|
||||
Assert.notNull(scope, "Scope must not be null");
|
||||
Assert.notNull(scope, "'scope' must not be null");
|
||||
InstanceSupplier<T> parent = this;
|
||||
return new InstanceSupplier<>() {
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
|
||||
* @return {@code true} if this name is an ancestor
|
||||
*/
|
||||
public boolean isParentOf(ConfigurationPropertyName name) {
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
if (getNumberOfElements() != name.getNumberOfElements() - 1) {
|
||||
return false;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
|
||||
* @return {@code true} if this name is an ancestor
|
||||
*/
|
||||
public boolean isAncestorOf(ConfigurationPropertyName name) {
|
||||
Assert.notNull(name, "Name must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
if (getNumberOfElements() >= name.getNumberOfElements()) {
|
||||
return false;
|
||||
}
|
||||
@@ -612,7 +612,7 @@ public final class ConfigurationPropertyName implements Comparable<Configuration
|
||||
|
||||
private static Elements elementsOf(CharSequence name, boolean returnNullIfInvalid, int parserCapacity) {
|
||||
if (name == null) {
|
||||
Assert.isTrue(returnNullIfInvalid, "Name must not be null");
|
||||
Assert.isTrue(returnNullIfInvalid, "'name' must not be null");
|
||||
return null;
|
||||
}
|
||||
if (name.isEmpty()) {
|
||||
|
||||
@@ -141,7 +141,7 @@ class GraylogExtendedLogFormatStructuredLogFormatter extends JsonWriterStructure
|
||||
}
|
||||
|
||||
private static void createAdditionalField(String name, Object value, BiConsumer<Object, Object> pairs) {
|
||||
Assert.notNull(name, "fieldName must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
if (!FIELD_NAME_VALID_PATTERN.matcher(name).matches()) {
|
||||
logger.warn(LogMessage.format("'%s' is not a valid field name according to GELF standard", name));
|
||||
return;
|
||||
|
||||
@@ -133,7 +133,7 @@ class GraylogExtendedLogFormatStructuredLogFormatter extends JsonWriterStructure
|
||||
}
|
||||
|
||||
private static void createAdditionalField(String name, Object value, BiConsumer<Object, Object> pairs) {
|
||||
Assert.notNull(name, "fieldName must not be null");
|
||||
Assert.notNull(name, "'name' must not be null");
|
||||
if (!FIELD_NAME_VALID_PATTERN.matcher(name).matches()) {
|
||||
logger.warn(LogMessage.format("'%s' is not a valid field name according to GELF standard", name));
|
||||
return;
|
||||
|
||||
@@ -132,7 +132,7 @@ public interface SslManagerBundle {
|
||||
* @since 3.5.0
|
||||
*/
|
||||
static SslManagerBundle from(TrustManagerFactory trustManagerFactory) {
|
||||
Assert.notNull(trustManagerFactory, "TrustManagerFactory must not be null");
|
||||
Assert.notNull(trustManagerFactory, "'trustManagerFactory' must not be null");
|
||||
KeyManagerFactory defaultKeyManagerFactory = createDefaultKeyManagerFactory();
|
||||
return of(defaultKeyManagerFactory, trustManagerFactory);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ public interface SslManagerBundle {
|
||||
* @since 3.5.0
|
||||
*/
|
||||
static SslManagerBundle from(TrustManager... trustManagers) {
|
||||
Assert.notNull(trustManagers, "TrustManagers must not be null");
|
||||
Assert.notNull(trustManagers, "'trustManagers' must not be null");
|
||||
KeyManagerFactory defaultKeyManagerFactory = createDefaultKeyManagerFactory();
|
||||
TrustManagerFactory defaultTrustManagerFactory = createDefaultTrustManagerFactory();
|
||||
return of(defaultKeyManagerFactory, FixedTrustManagerFactory.of(defaultTrustManagerFactory, trustManagers));
|
||||
|
||||
@@ -131,7 +131,7 @@ public class SimpleAsyncTaskSchedulerBuilder {
|
||||
* @see #additionalCustomizers(SimpleAsyncTaskSchedulerCustomizer...)
|
||||
*/
|
||||
public SimpleAsyncTaskSchedulerBuilder customizers(SimpleAsyncTaskSchedulerCustomizer... customizers) {
|
||||
Assert.notNull(customizers, "Customizers must not be null");
|
||||
Assert.notNull(customizers, "'customizers' must not be null");
|
||||
return customizers(Arrays.asList(customizers));
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class SimpleAsyncTaskSchedulerBuilder {
|
||||
*/
|
||||
public SimpleAsyncTaskSchedulerBuilder customizers(
|
||||
Iterable<? extends SimpleAsyncTaskSchedulerCustomizer> customizers) {
|
||||
Assert.notNull(customizers, "Customizers must not be null");
|
||||
Assert.notNull(customizers, "'customizers' must not be null");
|
||||
return new SimpleAsyncTaskSchedulerBuilder(this.threadNamePrefix, this.concurrencyLimit, this.virtualThreads,
|
||||
this.taskTerminationTimeout, this.taskDecorator, append(null, customizers));
|
||||
}
|
||||
@@ -160,7 +160,7 @@ public class SimpleAsyncTaskSchedulerBuilder {
|
||||
* @see #customizers(SimpleAsyncTaskSchedulerCustomizer...)
|
||||
*/
|
||||
public SimpleAsyncTaskSchedulerBuilder additionalCustomizers(SimpleAsyncTaskSchedulerCustomizer... customizers) {
|
||||
Assert.notNull(customizers, "Customizers must not be null");
|
||||
Assert.notNull(customizers, "'customizers' must not be null");
|
||||
return additionalCustomizers(Arrays.asList(customizers));
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ public class SimpleAsyncTaskSchedulerBuilder {
|
||||
*/
|
||||
public SimpleAsyncTaskSchedulerBuilder additionalCustomizers(
|
||||
Iterable<? extends SimpleAsyncTaskSchedulerCustomizer> customizers) {
|
||||
Assert.notNull(customizers, "Customizers must not be null");
|
||||
Assert.notNull(customizers, "'customizers' must not be null");
|
||||
return new SimpleAsyncTaskSchedulerBuilder(this.threadNamePrefix, this.concurrencyLimit, this.virtualThreads,
|
||||
this.taskTerminationTimeout, this.taskDecorator, append(this.customizers, customizers));
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ class ValueObjectBinderTests {
|
||||
private final String bar;
|
||||
|
||||
ValidatingConstructorBean(String foo, String bar) {
|
||||
Assert.notNull(foo, "Foo must not be null");
|
||||
Assert.notNull(foo, "'foo' must not be null");
|
||||
this.foo = foo;
|
||||
this.bar = bar;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class ConfigurationPropertyNameTests {
|
||||
@Test
|
||||
void ofNameShouldNotBeNull() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> ConfigurationPropertyName.of(null))
|
||||
.withMessageContaining("Name must not be null");
|
||||
.withMessageContaining("'name' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -30,7 +30,7 @@ public final class MockOrigin implements Origin {
|
||||
private final Origin parent;
|
||||
|
||||
private MockOrigin(String value, Origin parent) {
|
||||
Assert.notNull(value, "Value must not be null");
|
||||
Assert.notNull(value, "'value' must not be null");
|
||||
this.value = value;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@@ -79,14 +79,14 @@ class SimpleAsyncTaskSchedulerBuilderTests {
|
||||
void customizersWhenCustomizersAreNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> this.builder.customizers((SimpleAsyncTaskSchedulerCustomizer[]) null))
|
||||
.withMessageContaining("Customizers must not be null");
|
||||
.withMessageContaining("'customizers' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void customizersCollectionWhenCustomizersAreNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> this.builder.customizers((Set<SimpleAsyncTaskSchedulerCustomizer>) null))
|
||||
.withMessageContaining("Customizers must not be null");
|
||||
.withMessageContaining("'customizers' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -121,14 +121,14 @@ class SimpleAsyncTaskSchedulerBuilderTests {
|
||||
void additionalCustomizersWhenCustomizersAreNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> this.builder.additionalCustomizers((SimpleAsyncTaskSchedulerCustomizer[]) null))
|
||||
.withMessageContaining("Customizers must not be null");
|
||||
.withMessageContaining("'customizers' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void additionalCustomizersCollectionWhenCustomizersAreNullShouldThrowException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> this.builder.additionalCustomizers((Set<SimpleAsyncTaskSchedulerCustomizer>) null))
|
||||
.withMessageContaining("Customizers must not be null");
|
||||
.withMessageContaining("'customizers' must not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user