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 11/*
2- * Copyright 2012-2019 the original author or authors.
2+ * Copyright 2012-2020 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -308,7 +308,7 @@ public <T extends ThreadPoolTaskExecutor> T configure(T taskExecutor) {
308308 map .from (this .keepAlive ).asInt (Duration ::getSeconds ).to (taskExecutor ::setKeepAliveSeconds );
309309 map .from (this .allowCoreThreadTimeOut ).to (taskExecutor ::setAllowCoreThreadTimeOut );
310310 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 );
312312 map .from (this .threadNamePrefix ).whenHasText ().to (taskExecutor ::setThreadNamePrefix );
313313 map .from (this .taskDecorator ).to (taskExecutor ::setTaskDecorator );
314314 if (!CollectionUtils .isEmpty (this .customizers )) {
Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ void awaitTerminationShouldApply() {
6161 }
6262
6363 @ Test
64- void awaitTerminationPeriodShouldApply () {
65- Duration period = Duration .ofMinutes ( 1 );
64+ void awaitTerminationPeriodShouldApplyWithMillisecondPrecision () {
65+ Duration period = Duration .ofMillis ( 50 );
6666 ThreadPoolTaskExecutor executor = this .builder .awaitTerminationPeriod (period ).build ();
6767 assertThat (executor ).hasFieldOrPropertyWithValue ("awaitTerminationMillis" , period .toMillis ());
6868 }
You can’t perform that action at this time.
0 commit comments