pull/14318/head
Phillip Webb 6 years ago
parent 0252e5452b
commit c3de4c84f2

@ -101,7 +101,6 @@ public class DefaultEndpointObjectNameFactoryTests {
public void generateObjectNameWithUniqueNamesDeprecatedPropertyMismatchMainProperty() {
this.environment.setProperty("spring.jmx.unique-names", "false");
this.properties.setUniqueNames(true);
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("spring.jmx.unique-names");
this.thrown.expectMessage("management.endpoints.jmx.unique-names");

@ -72,10 +72,8 @@ public class CodecsAutoConfiguration {
@Bean
public CodecCustomizer loggingCodecCustomizer(InsightsProperties properties) {
return (configurer) -> {
configurer.defaultCodecs().enableLoggingRequestDetails(
properties.getWeb().isLogRequestDetails());
};
return (configurer) -> configurer.defaultCodecs().enableLoggingRequestDetails(
properties.getWeb().isLogRequestDetails());
}
}

@ -56,15 +56,12 @@ class KafkaStreamsAnnotationDrivenConfiguration {
Map<String, Object> streamsProperties = this.properties.buildStreamsProperties();
if (this.properties.getStreams().getApplicationId() == null) {
String applicationName = environment.getProperty("spring.application.name");
if (applicationName != null) {
streamsProperties.put(StreamsConfig.APPLICATION_ID_CONFIG,
applicationName);
}
else {
if (applicationName == null) {
throw new InvalidConfigurationPropertyValueException(
"spring.kafka.streams.application-id", null,
"This property is mandatory and fallback 'spring.application.name' is not set either.");
}
streamsProperties.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationName);
}
return new KafkaStreamsConfiguration(streamsProperties);
}

@ -17,7 +17,6 @@
package org.springframework.boot.autoconfigure.task;
import java.util.concurrent.Executor;
import java.util.stream.Collectors;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -66,14 +65,16 @@ public class TaskExecutionAutoConfiguration {
@ConditionalOnMissingBean
public TaskExecutorBuilder taskExecutorBuilder() {
TaskExecutionProperties.Pool pool = this.properties.getPool();
return new TaskExecutorBuilder().queueCapacity(pool.getQueueCapacity())
.corePoolSize(pool.getCoreSize()).maxPoolSize(pool.getMaxSize())
.allowCoreThreadTimeOut(pool.isAllowCoreThreadTimeout())
.keepAlive(pool.getKeepAlive())
.threadNamePrefix(this.properties.getThreadNamePrefix())
.customizers(this.taskExecutorCustomizers.stream()
.collect(Collectors.toList()))
.taskDecorator(this.taskDecorator.getIfUnique());
TaskExecutorBuilder builder = new TaskExecutorBuilder();
builder = builder.queueCapacity(pool.getQueueCapacity());
builder = builder.corePoolSize(pool.getCoreSize());
builder = builder.maxPoolSize(pool.getMaxSize());
builder = builder.allowCoreThreadTimeOut(pool.isAllowCoreThreadTimeout());
builder = builder.keepAlive(pool.getKeepAlive());
builder = builder.threadNamePrefix(this.properties.getThreadNamePrefix());
builder = builder.customizers(this.taskExecutorCustomizers);
builder = builder.taskDecorator(this.taskDecorator.getIfUnique());
return builder;
}
@Bean(name = APPLICATION_TASK_EXECUTOR_BEAN_NAME)

@ -16,8 +16,6 @@
package org.springframework.boot.autoconfigure.task;
import java.util.stream.Collectors;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
@ -55,9 +53,11 @@ public class TaskSchedulingAutoConfiguration {
@ConditionalOnMissingBean
public TaskSchedulerBuilder taskSchedulerBuilder(TaskSchedulingProperties properties,
ObjectProvider<TaskSchedulerCustomizer> taskSchedulerCustomizers) {
return new TaskSchedulerBuilder().poolSize(properties.getPool().getSize())
.threadNamePrefix(properties.getThreadNamePrefix()).customizers(
taskSchedulerCustomizers.stream().collect(Collectors.toList()));
TaskSchedulerBuilder builder = new TaskSchedulerBuilder();
builder = builder.poolSize(properties.getPool().getSize());
builder = builder.threadNamePrefix(properties.getThreadNamePrefix());
builder = builder.customizers(taskSchedulerCustomizers);
return builder;
}
}

@ -5879,9 +5879,9 @@ The following code shows a typical example:
----
[[boot-features-webclient-runtime]]
=== WebClient Runtime
Spring Boot will auto-detect which `ClientHttpConnector` to drive `WebClient`, depending
on the libraries available on the application classpath.
@ -5901,6 +5901,7 @@ You can learn more about the
options in the Spring Framework reference documentation].
[[boot-features-webclient-customization]]
=== WebClient Customization
There are three main approaches to `WebClient` customization, depending on how broadly you

@ -18,7 +18,6 @@ package org.springframework.boot.task;
import java.time.Duration;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
@ -59,11 +58,9 @@ public class TaskExecutorBuilder {
private final TaskDecorator taskDecorator;
private final Set<TaskExecutorCustomizer> taskExecutorCustomizers;
private final Set<TaskExecutorCustomizer> customizers;
public TaskExecutorBuilder(TaskExecutorCustomizer... taskExecutorCustomizers) {
Assert.notNull(taskExecutorCustomizers,
"TaskExecutorCustomizers must not be null");
public TaskExecutorBuilder() {
this.queueCapacity = null;
this.corePoolSize = null;
this.maxPoolSize = null;
@ -71,14 +68,13 @@ public class TaskExecutorBuilder {
this.keepAlive = null;
this.threadNamePrefix = null;
this.taskDecorator = null;
this.taskExecutorCustomizers = Collections.unmodifiableSet(
new LinkedHashSet<>(Arrays.asList(taskExecutorCustomizers)));
this.customizers = null;
}
public TaskExecutorBuilder(Integer queueCapacity, Integer corePoolSize,
private TaskExecutorBuilder(Integer queueCapacity, Integer corePoolSize,
Integer maxPoolSize, Boolean allowCoreThreadTimeOut, Duration keepAlive,
String threadNamePrefix, TaskDecorator taskDecorator,
Set<TaskExecutorCustomizer> taskExecutorCustomizers) {
Set<TaskExecutorCustomizer> customizers) {
this.queueCapacity = queueCapacity;
this.corePoolSize = corePoolSize;
this.maxPoolSize = maxPoolSize;
@ -86,7 +82,7 @@ public class TaskExecutorBuilder {
this.keepAlive = keepAlive;
this.threadNamePrefix = threadNamePrefix;
this.taskDecorator = taskDecorator;
this.taskExecutorCustomizers = taskExecutorCustomizers;
this.customizers = customizers;
}
/**
@ -98,7 +94,7 @@ public class TaskExecutorBuilder {
public TaskExecutorBuilder queueCapacity(int queueCapacity) {
return new TaskExecutorBuilder(queueCapacity, this.corePoolSize, this.maxPoolSize,
this.allowCoreThreadTimeOut, this.keepAlive, this.threadNamePrefix,
this.taskDecorator, this.taskExecutorCustomizers);
this.taskDecorator, this.customizers);
}
/**
@ -113,7 +109,7 @@ public class TaskExecutorBuilder {
public TaskExecutorBuilder corePoolSize(int corePoolSize) {
return new TaskExecutorBuilder(this.queueCapacity, corePoolSize, this.maxPoolSize,
this.allowCoreThreadTimeOut, this.keepAlive, this.threadNamePrefix,
this.taskDecorator, this.taskExecutorCustomizers);
this.taskDecorator, this.customizers);
}
/**
@ -128,7 +124,7 @@ public class TaskExecutorBuilder {
public TaskExecutorBuilder maxPoolSize(int maxPoolSize) {
return new TaskExecutorBuilder(this.queueCapacity, this.corePoolSize, maxPoolSize,
this.allowCoreThreadTimeOut, this.keepAlive, this.threadNamePrefix,
this.taskDecorator, this.taskExecutorCustomizers);
this.taskDecorator, this.customizers);
}
/**
@ -140,7 +136,7 @@ public class TaskExecutorBuilder {
public TaskExecutorBuilder allowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) {
return new TaskExecutorBuilder(this.queueCapacity, this.corePoolSize,
this.maxPoolSize, allowCoreThreadTimeOut, this.keepAlive,
this.threadNamePrefix, this.taskDecorator, this.taskExecutorCustomizers);
this.threadNamePrefix, this.taskDecorator, this.customizers);
}
/**
@ -151,7 +147,7 @@ public class TaskExecutorBuilder {
public TaskExecutorBuilder keepAlive(Duration keepAlive) {
return new TaskExecutorBuilder(this.queueCapacity, this.corePoolSize,
this.maxPoolSize, this.allowCoreThreadTimeOut, keepAlive,
this.threadNamePrefix, this.taskDecorator, this.taskExecutorCustomizers);
this.threadNamePrefix, this.taskDecorator, this.customizers);
}
/**
@ -162,7 +158,7 @@ public class TaskExecutorBuilder {
public TaskExecutorBuilder threadNamePrefix(String threadNamePrefix) {
return new TaskExecutorBuilder(this.queueCapacity, this.corePoolSize,
this.maxPoolSize, this.allowCoreThreadTimeOut, this.keepAlive,
threadNamePrefix, this.taskDecorator, this.taskExecutorCustomizers);
threadNamePrefix, this.taskDecorator, this.customizers);
}
/**
@ -173,7 +169,7 @@ public class TaskExecutorBuilder {
public TaskExecutorBuilder taskDecorator(TaskDecorator taskDecorator) {
return new TaskExecutorBuilder(this.queueCapacity, this.corePoolSize,
this.maxPoolSize, this.allowCoreThreadTimeOut, this.keepAlive,
this.threadNamePrefix, taskDecorator, this.taskExecutorCustomizers);
this.threadNamePrefix, taskDecorator, this.customizers);
}
/**
@ -181,15 +177,13 @@ public class TaskExecutorBuilder {
* applied to the {@link ThreadPoolTaskExecutor}. Customizers are applied in the order
* that they were added after builder configuration has been applied. Setting this
* value will replace any previously configured customizers.
* @param taskExecutorCustomizers the customizers to set
* @param customizers the customizers to set
* @return a new builder instance
* @see #additionalCustomizers(TaskExecutorCustomizer...)
*/
public TaskExecutorBuilder customizers(
TaskExecutorCustomizer... taskExecutorCustomizers) {
Assert.notNull(taskExecutorCustomizers,
"TaskExecutorCustomizers must not be null");
return customizers(Arrays.asList(taskExecutorCustomizers));
public TaskExecutorBuilder customizers(TaskExecutorCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return customizers(Arrays.asList(customizers));
}
/**
@ -197,52 +191,46 @@ public class TaskExecutorBuilder {
* applied to the {@link ThreadPoolTaskExecutor}. Customizers are applied in the order
* that they were added after builder configuration has been applied. Setting this
* value will replace any previously configured customizers.
* @param taskExecutorCustomizers the customizers to set
* @param customizers the customizers to set
* @return a new builder instance
* @see #additionalCustomizers(TaskExecutorCustomizer...)
*/
public TaskExecutorBuilder customizers(
Collection<? extends TaskExecutorCustomizer> taskExecutorCustomizers) {
Assert.notNull(taskExecutorCustomizers,
"TaskExecutorCustomizers must not be null");
public TaskExecutorBuilder customizers(Iterable<TaskExecutorCustomizer> customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return new TaskExecutorBuilder(this.queueCapacity, this.corePoolSize,
this.maxPoolSize, this.allowCoreThreadTimeOut, this.keepAlive,
this.threadNamePrefix, this.taskDecorator,
Collections.unmodifiableSet(new LinkedHashSet<TaskExecutorCustomizer>(
taskExecutorCustomizers)));
this.threadNamePrefix, this.taskDecorator, append(null, customizers));
}
/**
* Add {@link TaskExecutorCustomizer TaskExecutorCustomizers} that should be applied
* to the {@link ThreadPoolTaskExecutor}. Customizers are applied in the order that
* they were added after builder configuration has been applied.
* @param taskExecutorCustomizers the customizers to add
* @param customizers the customizers to add
* @return a new builder instance
* @see #customizers(TaskExecutorCustomizer...)
*/
public TaskExecutorBuilder additionalCustomizers(
TaskExecutorCustomizer... taskExecutorCustomizers) {
Assert.notNull(taskExecutorCustomizers,
"TaskExecutorCustomizers must not be null");
return additionalCustomizers(Arrays.asList(taskExecutorCustomizers));
TaskExecutorCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return additionalCustomizers(Arrays.asList(customizers));
}
/**
* Add {@link TaskExecutorCustomizer TaskExecutorCustomizers} that should be applied
* to the {@link ThreadPoolTaskExecutor}. Customizers are applied in the order that
* they were added after builder configuration has been applied.
* @param taskExecutorCustomizers the customizers to add
* @param customizers the customizers to add
* @return a new builder instance
* @see #customizers(TaskExecutorCustomizer...)
*/
public TaskExecutorBuilder additionalCustomizers(
Collection<? extends TaskExecutorCustomizer> taskExecutorCustomizers) {
Assert.notNull(taskExecutorCustomizers,
"TaskExecutorCustomizers must not be null");
Iterable<TaskExecutorCustomizer> customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return new TaskExecutorBuilder(this.queueCapacity, this.corePoolSize,
this.maxPoolSize, this.allowCoreThreadTimeOut, this.keepAlive,
this.threadNamePrefix, this.taskDecorator,
append(this.taskExecutorCustomizers, taskExecutorCustomizers));
append(this.customizers, customizers));
}
/**
@ -288,18 +276,15 @@ public class TaskExecutorBuilder {
map.from(this.threadNamePrefix).whenHasText()
.to(taskExecutor::setThreadNamePrefix);
map.from(this.taskDecorator).to(taskExecutor::setTaskDecorator);
if (!CollectionUtils.isEmpty(this.taskExecutorCustomizers)) {
for (TaskExecutorCustomizer customizer : this.taskExecutorCustomizers) {
customizer.customize(taskExecutor);
}
if (!CollectionUtils.isEmpty(this.customizers)) {
this.customizers.forEach((customizer) -> customizer.customize(taskExecutor));
}
return taskExecutor;
}
private static <T> Set<T> append(Set<T> set, Collection<? extends T> additions) {
private <T> Set<T> append(Set<T> set, Iterable<? extends T> additions) {
Set<T> result = new LinkedHashSet<>((set != null) ? set : Collections.emptySet());
result.addAll(additions);
additions.forEach(result::add);
return Collections.unmodifiableSet(result);
}

@ -17,7 +17,6 @@
package org.springframework.boot.task;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
@ -45,22 +44,19 @@ public class TaskSchedulerBuilder {
private final String threadNamePrefix;
private final Set<TaskSchedulerCustomizer> taskSchedulerCustomizers;
private final Set<TaskSchedulerCustomizer> customizers;
public TaskSchedulerBuilder(TaskSchedulerCustomizer... taskSchedulerCustomizers) {
Assert.notNull(taskSchedulerCustomizers,
"TaskSchedulerCustomizers must not be null");
public TaskSchedulerBuilder() {
this.poolSize = null;
this.threadNamePrefix = null;
this.taskSchedulerCustomizers = Collections.unmodifiableSet(
new LinkedHashSet<>(Arrays.asList(taskSchedulerCustomizers)));
this.customizers = null;
}
public TaskSchedulerBuilder(Integer poolSize, String threadNamePrefix,
Set<TaskSchedulerCustomizer> taskSchedulerCustomizers) {
this.poolSize = poolSize;
this.threadNamePrefix = threadNamePrefix;
this.taskSchedulerCustomizers = taskSchedulerCustomizers;
this.customizers = taskSchedulerCustomizers;
}
/**
@ -70,7 +66,7 @@ public class TaskSchedulerBuilder {
*/
public TaskSchedulerBuilder poolSize(int poolSize) {
return new TaskSchedulerBuilder(poolSize, this.threadNamePrefix,
this.taskSchedulerCustomizers);
this.customizers);
}
/**
@ -80,7 +76,7 @@ public class TaskSchedulerBuilder {
*/
public TaskSchedulerBuilder threadNamePrefix(String threadNamePrefix) {
return new TaskSchedulerBuilder(this.poolSize, threadNamePrefix,
this.taskSchedulerCustomizers);
this.customizers);
}
/**
@ -88,15 +84,13 @@ public class TaskSchedulerBuilder {
* applied to the {@link ThreadPoolTaskScheduler}. Customizers are applied in the
* order that they were added after builder configuration has been applied. Setting
* this value will replace any previously configured customizers.
* @param taskSchedulerCustomizers the customizers to set
* @param customizers the customizers to set
* @return a new builder instance
* @see #additionalCustomizers(TaskSchedulerCustomizer...)
*/
public TaskSchedulerBuilder customizers(
TaskSchedulerCustomizer... taskSchedulerCustomizers) {
Assert.notNull(taskSchedulerCustomizers,
"TaskSchedulerCustomizers must not be null");
return customizers(Arrays.asList(taskSchedulerCustomizers));
public TaskSchedulerBuilder customizers(TaskSchedulerCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return customizers(Arrays.asList(customizers));
}
/**
@ -104,48 +98,44 @@ public class TaskSchedulerBuilder {
* applied to the {@link ThreadPoolTaskScheduler}. Customizers are applied in the
* order that they were added after builder configuration has been applied. Setting
* this value will replace any previously configured customizers.
* @param taskSchedulerCustomizers the customizers to set
* @param customizers the customizers to set
* @return a new builder instance
* @see #additionalCustomizers(TaskSchedulerCustomizer...)
*/
public TaskSchedulerBuilder customizers(
Collection<? extends TaskSchedulerCustomizer> taskSchedulerCustomizers) {
Assert.notNull(taskSchedulerCustomizers,
"TaskSchedulerCustomizers must not be null");
Iterable<TaskSchedulerCustomizer> customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return new TaskSchedulerBuilder(this.poolSize, this.threadNamePrefix,
Collections.unmodifiableSet(new LinkedHashSet<TaskSchedulerCustomizer>(
taskSchedulerCustomizers)));
append(null, customizers));
}
/**
* Add {@link TaskSchedulerCustomizer taskSchedulerCustomizers} that should be applied
* to the {@link ThreadPoolTaskScheduler}. Customizers are applied in the order that
* they were added after builder configuration has been applied.
* @param taskSchedulerCustomizers the customizers to add
* @param customizers the customizers to add
* @return a new builder instance
* @see #customizers(TaskSchedulerCustomizer...)
*/
public TaskSchedulerBuilder additionalCustomizers(
TaskSchedulerCustomizer... taskSchedulerCustomizers) {
Assert.notNull(taskSchedulerCustomizers,
"TaskSchedulerCustomizers must not be null");
return additionalCustomizers(Arrays.asList(taskSchedulerCustomizers));
TaskSchedulerCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return additionalCustomizers(Arrays.asList(customizers));
}
/**
* Add {@link TaskSchedulerCustomizer taskSchedulerCustomizers} that should be applied
* to the {@link ThreadPoolTaskScheduler}. Customizers are applied in the order that
* they were added after builder configuration has been applied.
* @param taskSchedulerCustomizers the customizers to add
* @param customizers the customizers to add
* @return a new builder instance
* @see #customizers(TaskSchedulerCustomizer...)
*/
public TaskSchedulerBuilder additionalCustomizers(
Collection<? extends TaskSchedulerCustomizer> taskSchedulerCustomizers) {
Assert.notNull(taskSchedulerCustomizers,
"TaskSchedulerCustomizers must not be null");
Iterable<TaskSchedulerCustomizer> customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return new TaskSchedulerBuilder(this.poolSize, this.threadNamePrefix,
append(this.taskSchedulerCustomizers, taskSchedulerCustomizers));
append(this.customizers, customizers));
}
/**
@ -169,18 +159,15 @@ public class TaskSchedulerBuilder {
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
map.from(this.poolSize).to(taskScheduler::setPoolSize);
map.from(this.threadNamePrefix).to(taskScheduler::setThreadNamePrefix);
if (!CollectionUtils.isEmpty(this.taskSchedulerCustomizers)) {
for (TaskSchedulerCustomizer customizer : this.taskSchedulerCustomizers) {
customizer.customize(taskScheduler);
}
if (!CollectionUtils.isEmpty(this.customizers)) {
this.customizers.forEach((customizer) -> customizer.customize(taskScheduler));
}
return taskScheduler;
}
private static <T> Set<T> append(Set<T> set, Collection<? extends T> additions) {
private <T> Set<T> append(Set<T> set, Iterable<? extends T> additions) {
Set<T> result = new LinkedHashSet<>((set != null) ? set : Collections.emptySet());
result.addAll(additions);
additions.forEach(result::add);
return Collections.unmodifiableSet(result);
}

@ -47,13 +47,6 @@ public class TaskExecutorBuilderTests {
private TaskExecutorBuilder builder = new TaskExecutorBuilder();
@Test
public void createWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskExecutorCustomizers must not be null");
new TaskExecutorBuilder((TaskExecutorCustomizer[]) null);
}
@Test
public void poolSettingsShouldApply() {
ThreadPoolTaskExecutor executor = this.builder.queueCapacity(10).corePoolSize(4)
@ -85,14 +78,14 @@ public class TaskExecutorBuilderTests {
@Test
public void customizersWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskExecutorCustomizers must not be null");
this.thrown.expectMessage("Customizers must not be null");
this.builder.customizers((TaskExecutorCustomizer[]) null);
}
@Test
public void customizersCollectionWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskExecutorCustomizers must not be null");
this.thrown.expectMessage("Customizers must not be null");
this.builder.customizers((Set<TaskExecutorCustomizer>) null);
}
@ -135,14 +128,14 @@ public class TaskExecutorBuilderTests {
@Test
public void additionalCustomizersWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskExecutorCustomizers must not be null");
this.thrown.expectMessage("Customizers must not be null");
this.builder.additionalCustomizers((TaskExecutorCustomizer[]) null);
}
@Test
public void additionalCustomizersCollectionWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskExecutorCustomizers must not be null");
this.thrown.expectMessage("Customizers must not be null");
this.builder.additionalCustomizers((Set<TaskExecutorCustomizer>) null);
}

@ -43,13 +43,6 @@ public class TaskSchedulerBuilderTests {
private TaskSchedulerBuilder builder = new TaskSchedulerBuilder();
@Test
public void createWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskSchedulerCustomizers must not be null");
new TaskSchedulerBuilder((TaskSchedulerCustomizer[]) null);
}
@Test
public void poolSettingsShouldApply() {
ThreadPoolTaskScheduler scheduler = this.builder.poolSize(4).build();
@ -66,14 +59,14 @@ public class TaskSchedulerBuilderTests {
@Test
public void customizersWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskSchedulerCustomizers must not be null");
this.thrown.expectMessage("Customizers must not be null");
this.builder.customizers((TaskSchedulerCustomizer[]) null);
}
@Test
public void customizersCollectionWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskSchedulerCustomizers must not be null");
this.thrown.expectMessage("Customizers must not be null");
this.builder.customizers((Set<TaskSchedulerCustomizer>) null);
}
@ -108,14 +101,14 @@ public class TaskSchedulerBuilderTests {
@Test
public void additionalCustomizersWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskSchedulerCustomizers must not be null");
this.thrown.expectMessage("Customizers must not be null");
this.builder.additionalCustomizers((TaskSchedulerCustomizer[]) null);
}
@Test
public void additionalCustomizersCollectionWhenCustomizersAreNullShouldThrowException() {
this.thrown.expect(IllegalArgumentException.class);
this.thrown.expectMessage("TaskSchedulerCustomizers must not be null");
this.thrown.expectMessage("Customizers must not be null");
this.builder.additionalCustomizers((Set<TaskSchedulerCustomizer>) null);
}

Loading…
Cancel
Save