File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
spring-boot-project/spring-boot/src
main/java/org/springframework/boot/task
test/java/org/springframework/boot/task Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2012-2019 the original author or authors.
2
+ * Copyright 2012-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -308,7 +308,7 @@ public <T extends ThreadPoolTaskExecutor> T configure(T taskExecutor) {
308
308
map .from (this .keepAlive ).asInt (Duration ::getSeconds ).to (taskExecutor ::setKeepAliveSeconds );
309
309
map .from (this .allowCoreThreadTimeOut ).to (taskExecutor ::setAllowCoreThreadTimeOut );
310
310
map .from (this .awaitTermination ).to (taskExecutor ::setWaitForTasksToCompleteOnShutdown );
311
- map .from (this .awaitTerminationPeriod ).asInt (Duration ::getSeconds ).to (taskExecutor ::setAwaitTerminationSeconds );
311
+ map .from (this .awaitTerminationPeriod ).as (Duration ::toMillis ).to (taskExecutor ::setAwaitTerminationMillis );
312
312
map .from (this .threadNamePrefix ).whenHasText ().to (taskExecutor ::setThreadNamePrefix );
313
313
map .from (this .taskDecorator ).to (taskExecutor ::setTaskDecorator );
314
314
if (!CollectionUtils .isEmpty (this .customizers )) {
Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ void awaitTerminationShouldApply() {
61
61
}
62
62
63
63
@ Test
64
- void awaitTerminationPeriodShouldApply () {
65
- Duration period = Duration .ofMinutes ( 1 );
64
+ void awaitTerminationPeriodShouldApplyWithMillisecondPrecision () {
65
+ Duration period = Duration .ofMillis ( 50 );
66
66
ThreadPoolTaskExecutor executor = this .builder .awaitTerminationPeriod (period ).build ();
67
67
assertThat (executor ).hasFieldOrPropertyWithValue ("awaitTerminationMillis" , period .toMillis ());
68
68
}
You can’t perform that action at this time.
0 commit comments