Skip to content

Commit 02d095d

Browse files
committed
Merge pull request #19985 from dreis2211
* pr/19985: Polish "Use new AssertJ duration assertions" Use new AssertJ duration assertions Upgrade to AssertJ 3.15.0 Closes gh-19985
2 parents c6a6024 + bae1d8d commit 02d095d

File tree

13 files changed

+108
-117
lines changed

13 files changed

+108
-117
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/PushRegistryPropertiesConfigAdapterTests.java

Lines changed: 2 additions & 2 deletions
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.
@@ -40,7 +40,7 @@ public abstract class PushRegistryPropertiesConfigAdapterTests<P extends PushReg
4040
void whenPropertiesStepIsSetAdapterStepReturnsIt() {
4141
P properties = createProperties();
4242
properties.setStep(Duration.ofSeconds(42));
43-
assertThat(createConfigAdapter(properties).step()).isEqualTo(Duration.ofSeconds(42));
43+
assertThat(createConfigAdapter(properties).step()).hasSeconds(42);
4444
}
4545

4646
@Test

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsPropertiesTests.java

Lines changed: 2 additions & 2 deletions
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.
@@ -83,7 +83,7 @@ void setTimeToLiveEnablesQoS() {
8383
@Test
8484
void defaultReceiveTimeoutMatchesListenerContainersDefault() {
8585
assertThat(new JmsProperties().getListener().getReceiveTimeout())
86-
.isEqualTo(Duration.ofMillis(AbstractPollingMessageListenerContainer.DEFAULT_RECEIVE_TIMEOUT));
86+
.hasMillis(AbstractPollingMessageListenerContainer.DEFAULT_RECEIVE_TIMEOUT);
8787
}
8888

8989
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java

Lines changed: 3 additions & 6 deletions
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.
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.boot.autoconfigure.session;
1818

19-
import java.time.Duration;
2019
import java.util.Collections;
2120
import java.util.EnumSet;
2221

@@ -98,17 +97,15 @@ void autoConfigWhenSpringSessionTimeoutIsSetShouldUseThat() {
9897
this.contextRunner
9998
.withUserConfiguration(ServerPropertiesConfiguration.class, SessionRepositoryConfiguration.class)
10099
.withPropertyValues("server.servlet.session.timeout=1", "spring.session.timeout=3")
101-
.run((context) -> assertThat(context.getBean(SessionProperties.class).getTimeout())
102-
.isEqualTo(Duration.ofSeconds(3)));
100+
.run((context) -> assertThat(context.getBean(SessionProperties.class).getTimeout()).hasSeconds(3));
103101
}
104102

105103
@Test
106104
void autoConfigWhenSpringSessionTimeoutIsNotSetShouldUseServerSessionTimeout() {
107105
this.contextRunner
108106
.withUserConfiguration(ServerPropertiesConfiguration.class, SessionRepositoryConfiguration.class)
109107
.withPropertyValues("server.servlet.session.timeout=3")
110-
.run((context) -> assertThat(context.getBean(SessionProperties.class).getTimeout())
111-
.isEqualTo(Duration.ofSeconds(3)));
108+
.run((context) -> assertThat(context.getBean(SessionProperties.class).getTimeout()).hasSeconds(3));
112109
}
113110

114111
@SuppressWarnings("unchecked")

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java

Lines changed: 5 additions & 6 deletions
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.
@@ -20,7 +20,6 @@
2020
import java.net.InetAddress;
2121
import java.net.URI;
2222
import java.nio.charset.StandardCharsets;
23-
import java.time.Duration;
2423
import java.util.Collections;
2524
import java.util.HashMap;
2625
import java.util.Map;
@@ -107,7 +106,7 @@ void testServerHeader() {
107106
@Test
108107
void testConnectionTimeout() {
109108
bind("server.connection-timeout", "60s");
110-
assertThat(this.properties.getConnectionTimeout()).isEqualTo(Duration.ofMillis(60000));
109+
assertThat(this.properties.getConnectionTimeout()).hasMillis(60000);
111110
}
112111

113112
@Test
@@ -149,7 +148,7 @@ void testTomcatBinding() {
149148
assertThat(tomcat.getRemoteIpHeader()).isEqualTo("Remote-Ip");
150149
assertThat(tomcat.getProtocolHeader()).isEqualTo("X-Forwarded-Protocol");
151150
assertThat(tomcat.getInternalProxies()).isEqualTo("10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}");
152-
assertThat(tomcat.getBackgroundProcessorDelay()).isEqualTo(Duration.ofSeconds(10));
151+
assertThat(tomcat.getBackgroundProcessorDelay()).hasSeconds(10);
153152
assertThat(tomcat.getRelaxedPathChars()).containsExactly('|', '<');
154153
assertThat(tomcat.getRelaxedQueryChars()).containsExactly('^', '|');
155154
}
@@ -235,7 +234,7 @@ void testCustomizeJettyMinThreads() {
235234
@Test
236235
void testCustomizeJettyIdleTimeout() {
237236
bind("server.jetty.thread-idle-timeout", "10s");
238-
assertThat(this.properties.getJetty().getThreadIdleTimeout()).isEqualTo(Duration.ofSeconds(10));
237+
assertThat(this.properties.getJetty().getThreadIdleTimeout()).hasSeconds(10);
239238
}
240239

241240
@Test
@@ -308,7 +307,7 @@ void tomcatMaxHttpPostSizeMatchesConnectorDefault() throws Exception {
308307
@Test
309308
void tomcatBackgroundProcessorDelayMatchesEngineDefault() {
310309
assertThat(this.properties.getTomcat().getBackgroundProcessorDelay())
311-
.isEqualTo(Duration.ofSeconds((new StandardEngine().getBackgroundProcessorDelay())));
310+
.hasSeconds((new StandardEngine().getBackgroundProcessorDelay()));
312311
}
313312

314313
@Test

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryCustomizerTests.java

Lines changed: 3 additions & 4 deletions
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.
@@ -17,7 +17,6 @@
1717
package org.springframework.boot.autoconfigure.web.servlet;
1818

1919
import java.io.File;
20-
import java.time.Duration;
2120
import java.util.HashMap;
2221
import java.util.Map;
2322

@@ -106,14 +105,14 @@ void customizeSessionProperties() throws Exception {
106105
this.customizer.customize(factory);
107106
ArgumentCaptor<Session> sessionCaptor = ArgumentCaptor.forClass(Session.class);
108107
verify(factory).setSession(sessionCaptor.capture());
109-
assertThat(sessionCaptor.getValue().getTimeout()).isEqualTo(Duration.ofSeconds(123));
108+
assertThat(sessionCaptor.getValue().getTimeout()).hasSeconds(123);
110109
Cookie cookie = sessionCaptor.getValue().getCookie();
111110
assertThat(cookie.getName()).isEqualTo("testname");
112111
assertThat(cookie.getDomain()).isEqualTo("testdomain");
113112
assertThat(cookie.getPath()).isEqualTo("/testpath");
114113
assertThat(cookie.getComment()).isEqualTo("testcomment");
115114
assertThat(cookie.getHttpOnly()).isTrue();
116-
assertThat(cookie.getMaxAge()).isEqualTo(Duration.ofSeconds(60));
115+
assertThat(cookie.getMaxAge()).hasSeconds(60);
117116

118117
}
119118

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ bom {
101101
]
102102
}
103103
}
104-
library("AssertJ", "3.14.0") {
104+
library("AssertJ", "3.15.0") {
105105
group("org.assertj") {
106106
modules = [
107107
"assertj-core"

spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java

Lines changed: 2 additions & 3 deletions
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.
@@ -17,7 +17,6 @@
1717
package org.springframework.boot.devtools.autoconfigure;
1818

1919
import java.io.File;
20-
import java.time.Duration;
2120
import java.util.Collections;
2221
import java.util.HashMap;
2322
import java.util.Map;
@@ -115,7 +114,7 @@ void defaultPropertyCanBeOverriddenFromUserHomeProperties() throws Exception {
115114
void resourceCachePeriodIsZero() throws Exception {
116115
this.context = getContext(() -> initializeAndRun(WebResourcesConfig.class));
117116
ResourceProperties properties = this.context.getBean(ResourceProperties.class);
118-
assertThat(properties.getCache().getPeriod()).isEqualTo(Duration.ZERO);
117+
assertThat(properties.getCache().getPeriod()).isZero();
119118
}
120119

121120
@Test

spring-boot-project/spring-boot-docs/src/test/java/org/springframework/boot/docs/context/properties/bind/AppSystemPropertiesTests.java

Lines changed: 7 additions & 8 deletions
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.
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.boot.docs.context.properties.bind;
1818

19-
import java.time.Duration;
2019
import java.util.function.Consumer;
2120

2221
import org.junit.jupiter.api.Test;
@@ -43,26 +42,26 @@ class AppSystemPropertiesTests {
4342
void bindWithDefaultUnit() {
4443
this.contextRunner.withPropertyValues("app.system.session-timeout=40", "app.system.read-timeout=5000")
4544
.run(assertBinding((properties) -> {
46-
assertThat(properties.getSessionTimeout()).isEqualTo(Duration.ofSeconds(40));
47-
assertThat(properties.getReadTimeout()).isEqualTo(Duration.ofMillis(5000));
45+
assertThat(properties.getSessionTimeout()).hasSeconds(40);
46+
assertThat(properties.getReadTimeout()).hasMillis(5000);
4847
}));
4948
}
5049

5150
@Test
5251
void bindWithExplicitUnit() {
5352
this.contextRunner.withPropertyValues("app.system.session-timeout=1h", "app.system.read-timeout=5s")
5453
.run(assertBinding((properties) -> {
55-
assertThat(properties.getSessionTimeout()).isEqualTo(Duration.ofMinutes(60));
56-
assertThat(properties.getReadTimeout()).isEqualTo(Duration.ofMillis(5000));
54+
assertThat(properties.getSessionTimeout()).hasMinutes(60);
55+
assertThat(properties.getReadTimeout()).hasMillis(5000);
5756
}));
5857
}
5958

6059
@Test
6160
void bindWithIso8601Format() {
6261
this.contextRunner.withPropertyValues("app.system.session-timeout=PT15S", "app.system.read-timeout=PT0.5S")
6362
.run(assertBinding((properties) -> {
64-
assertThat(properties.getSessionTimeout()).isEqualTo(Duration.ofSeconds(15));
65-
assertThat(properties.getReadTimeout()).isEqualTo(Duration.ofMillis(500));
63+
assertThat(properties.getSessionTimeout()).hasSeconds(15);
64+
assertThat(properties.getReadTimeout()).hasMillis(500);
6665
}));
6766
}
6867

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebTestClientAutoConfigurationTests.java

Lines changed: 2 additions & 4 deletions
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.
@@ -17,7 +17,6 @@
1717
package org.springframework.boot.test.autoconfigure.web.reactive;
1818

1919
import java.time.Duration;
20-
import java.time.temporal.ChronoUnit;
2120
import java.util.List;
2221

2322
import org.junit.jupiter.api.Test;
@@ -75,8 +74,7 @@ void shouldCustomizeTimeout() {
7574
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
7675
.withPropertyValues("spring.test.webtestclient.timeout=15m").run((context) -> {
7776
WebTestClient webTestClient = context.getBean(WebTestClient.class);
78-
Object duration = ReflectionTestUtils.getField(webTestClient, "timeout");
79-
assertThat(duration).isEqualTo(Duration.of(15, ChronoUnit.MINUTES));
77+
assertThat(webTestClient).hasFieldOrPropertyWithValue("timeout", Duration.ofMinutes(15));
8078
});
8179
}
8280

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/convert/DurationStyleTests.java

Lines changed: 38 additions & 38 deletions
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.
@@ -51,72 +51,72 @@ void detectAndParseWhenIso8601ShouldReturnDuration() {
5151

5252
@Test
5353
void detectAndParseWhenSimpleNanosShouldReturnDuration() {
54-
assertThat(DurationStyle.detectAndParse("10ns")).isEqualTo(Duration.ofNanos(10));
55-
assertThat(DurationStyle.detectAndParse("10NS")).isEqualTo(Duration.ofNanos(10));
56-
assertThat(DurationStyle.detectAndParse("+10ns")).isEqualTo(Duration.ofNanos(10));
57-
assertThat(DurationStyle.detectAndParse("-10ns")).isEqualTo(Duration.ofNanos(-10));
54+
assertThat(DurationStyle.detectAndParse("10ns")).hasNanos(10);
55+
assertThat(DurationStyle.detectAndParse("10NS")).hasNanos(10);
56+
assertThat(DurationStyle.detectAndParse("+10ns")).hasNanos(10);
57+
assertThat(DurationStyle.detectAndParse("-10ns")).hasNanos(-10);
5858
}
5959

6060
@Test
6161
void detectAndParseWhenSimpleMicrosShouldReturnDuration() {
62-
assertThat(DurationStyle.detectAndParse("10us")).isEqualTo(Duration.ofNanos(10000));
63-
assertThat(DurationStyle.detectAndParse("10US")).isEqualTo(Duration.ofNanos(10000));
64-
assertThat(DurationStyle.detectAndParse("+10us")).isEqualTo(Duration.ofNanos(10000));
65-
assertThat(DurationStyle.detectAndParse("-10us")).isEqualTo(Duration.ofNanos(-10000));
62+
assertThat(DurationStyle.detectAndParse("10us")).hasNanos(10000);
63+
assertThat(DurationStyle.detectAndParse("10US")).hasNanos(10000);
64+
assertThat(DurationStyle.detectAndParse("+10us")).hasNanos(10000);
65+
assertThat(DurationStyle.detectAndParse("-10us")).hasNanos(-10000);
6666
}
6767

6868
@Test
6969
void detectAndParseWhenSimpleMillisShouldReturnDuration() {
70-
assertThat(DurationStyle.detectAndParse("10ms")).isEqualTo(Duration.ofMillis(10));
71-
assertThat(DurationStyle.detectAndParse("10MS")).isEqualTo(Duration.ofMillis(10));
72-
assertThat(DurationStyle.detectAndParse("+10ms")).isEqualTo(Duration.ofMillis(10));
73-
assertThat(DurationStyle.detectAndParse("-10ms")).isEqualTo(Duration.ofMillis(-10));
70+
assertThat(DurationStyle.detectAndParse("10ms")).hasMillis(10);
71+
assertThat(DurationStyle.detectAndParse("10MS")).hasMillis(10);
72+
assertThat(DurationStyle.detectAndParse("+10ms")).hasMillis(10);
73+
assertThat(DurationStyle.detectAndParse("-10ms")).hasMillis(-10);
7474
}
7575

7676
@Test
7777
void detectAndParseWhenSimpleSecondsShouldReturnDuration() {
78-
assertThat(DurationStyle.detectAndParse("10s")).isEqualTo(Duration.ofSeconds(10));
79-
assertThat(DurationStyle.detectAndParse("10S")).isEqualTo(Duration.ofSeconds(10));
80-
assertThat(DurationStyle.detectAndParse("+10s")).isEqualTo(Duration.ofSeconds(10));
81-
assertThat(DurationStyle.detectAndParse("-10s")).isEqualTo(Duration.ofSeconds(-10));
78+
assertThat(DurationStyle.detectAndParse("10s")).hasSeconds(10);
79+
assertThat(DurationStyle.detectAndParse("10S")).hasSeconds(10);
80+
assertThat(DurationStyle.detectAndParse("+10s")).hasSeconds(10);
81+
assertThat(DurationStyle.detectAndParse("-10s")).hasSeconds(-10);
8282
}
8383

8484
@Test
8585
void detectAndParseWhenSimpleMinutesShouldReturnDuration() {
86-
assertThat(DurationStyle.detectAndParse("10m")).isEqualTo(Duration.ofMinutes(10));
87-
assertThat(DurationStyle.detectAndParse("10M")).isEqualTo(Duration.ofMinutes(10));
88-
assertThat(DurationStyle.detectAndParse("+10m")).isEqualTo(Duration.ofMinutes(10));
89-
assertThat(DurationStyle.detectAndParse("-10m")).isEqualTo(Duration.ofMinutes(-10));
86+
assertThat(DurationStyle.detectAndParse("10m")).hasMinutes(10);
87+
assertThat(DurationStyle.detectAndParse("10M")).hasMinutes(10);
88+
assertThat(DurationStyle.detectAndParse("+10m")).hasMinutes(10);
89+
assertThat(DurationStyle.detectAndParse("-10m")).hasMinutes(-10);
9090
}
9191

9292
@Test
9393
void detectAndParseWhenSimpleHoursShouldReturnDuration() {
94-
assertThat(DurationStyle.detectAndParse("10h")).isEqualTo(Duration.ofHours(10));
95-
assertThat(DurationStyle.detectAndParse("10H")).isEqualTo(Duration.ofHours(10));
96-
assertThat(DurationStyle.detectAndParse("+10h")).isEqualTo(Duration.ofHours(10));
97-
assertThat(DurationStyle.detectAndParse("-10h")).isEqualTo(Duration.ofHours(-10));
94+
assertThat(DurationStyle.detectAndParse("10h")).hasHours(10);
95+
assertThat(DurationStyle.detectAndParse("10H")).hasHours(10);
96+
assertThat(DurationStyle.detectAndParse("+10h")).hasHours(10);
97+
assertThat(DurationStyle.detectAndParse("-10h")).hasHours(-10);
9898
}
9999

100100
@Test
101101
void detectAndParseWhenSimpleDaysShouldReturnDuration() {
102-
assertThat(DurationStyle.detectAndParse("10d")).isEqualTo(Duration.ofDays(10));
103-
assertThat(DurationStyle.detectAndParse("10D")).isEqualTo(Duration.ofDays(10));
104-
assertThat(DurationStyle.detectAndParse("+10d")).isEqualTo(Duration.ofDays(10));
105-
assertThat(DurationStyle.detectAndParse("-10d")).isEqualTo(Duration.ofDays(-10));
102+
assertThat(DurationStyle.detectAndParse("10d")).hasDays(10);
103+
assertThat(DurationStyle.detectAndParse("10D")).hasDays(10);
104+
assertThat(DurationStyle.detectAndParse("+10d")).hasDays(10);
105+
assertThat(DurationStyle.detectAndParse("-10d")).hasDays(-10);
106106
}
107107

108108
@Test
109109
void detectAndParseWhenSimpleWithoutSuffixShouldReturnDuration() {
110-
assertThat(DurationStyle.detectAndParse("10")).isEqualTo(Duration.ofMillis(10));
111-
assertThat(DurationStyle.detectAndParse("+10")).isEqualTo(Duration.ofMillis(10));
112-
assertThat(DurationStyle.detectAndParse("-10")).isEqualTo(Duration.ofMillis(-10));
110+
assertThat(DurationStyle.detectAndParse("10")).hasMillis(10);
111+
assertThat(DurationStyle.detectAndParse("+10")).hasMillis(10);
112+
assertThat(DurationStyle.detectAndParse("-10")).hasMillis(-10);
113113
}
114114

115115
@Test
116116
void detectAndParseWhenSimpleWithoutSuffixButWithChronoUnitShouldReturnDuration() {
117-
assertThat(DurationStyle.detectAndParse("10", ChronoUnit.SECONDS)).isEqualTo(Duration.ofSeconds(10));
118-
assertThat(DurationStyle.detectAndParse("+10", ChronoUnit.SECONDS)).isEqualTo(Duration.ofSeconds(10));
119-
assertThat(DurationStyle.detectAndParse("-10", ChronoUnit.SECONDS)).isEqualTo(Duration.ofSeconds(-10));
117+
assertThat(DurationStyle.detectAndParse("10", ChronoUnit.SECONDS)).hasSeconds(10);
118+
assertThat(DurationStyle.detectAndParse("+10", ChronoUnit.SECONDS)).hasSeconds(10);
119+
assertThat(DurationStyle.detectAndParse("-10", ChronoUnit.SECONDS)).hasSeconds(-10);
120120
}
121121

122122
@Test
@@ -191,13 +191,13 @@ void parseIso8601WhenSimpleShouldThrowException() {
191191

192192
@Test
193193
void parseSimpleShouldParse() {
194-
assertThat(DurationStyle.SIMPLE.parse("10m")).isEqualTo(Duration.ofMinutes(10));
194+
assertThat(DurationStyle.SIMPLE.parse("10m")).hasMinutes(10);
195195
}
196196

197197
@Test
198198
void parseSimpleWithUnitShouldUseUnitAsFallback() {
199-
assertThat(DurationStyle.SIMPLE.parse("10m", ChronoUnit.SECONDS)).isEqualTo(Duration.ofMinutes(10));
200-
assertThat(DurationStyle.SIMPLE.parse("10", ChronoUnit.MINUTES)).isEqualTo(Duration.ofMinutes(10));
199+
assertThat(DurationStyle.SIMPLE.parse("10m", ChronoUnit.SECONDS)).hasMinutes(10);
200+
assertThat(DurationStyle.SIMPLE.parse("10", ChronoUnit.MINUTES)).hasMinutes(10);
201201
}
202202

203203
@Test

0 commit comments

Comments
 (0)