Skip to content

Commit ea5284c

Browse files
committed
Polish "Use milliseconds when configuring awaitTerminationPeriod"
See gh-22604
1 parent 685a611 commit ea5284c

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/task/TaskExecutorBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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.

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/task/TaskExecutorBuilderTests.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,10 @@ 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());
68-
69-
period = Duration.ofMillis(50);
70-
executor = this.builder.awaitTerminationPeriod(period).build();
71-
assertThat(executor).hasFieldOrPropertyWithValue("awaitTerminationMillis", period.toMillis());
7268
}
7369

7470
@Test

0 commit comments

Comments
 (0)