12
12
13
13
import static org .assertj .core .api .Assertions .assertThat ;
14
14
import static org .junit .jupiter .api .io .CleanupMode .NEVER ;
15
+ import static org .junit .jupiter .params .converter .LocaleConversionFormat .ISO_639 ;
15
16
import static org .mockito .Mockito .mock ;
16
17
import static org .mockito .Mockito .only ;
17
18
import static org .mockito .Mockito .times ;
@@ -95,7 +96,7 @@ void cachesDefaultDisplayNameGenerator() {
95
96
CustomDisplayNameGenerator customDisplayNameGenerator = new CustomDisplayNameGenerator ();
96
97
when (delegate .getDefaultDisplayNameGenerator ()).thenReturn (customDisplayNameGenerator );
97
98
98
- // call `cache.getDefaultDisplayNameGenerator()` twice to verify the delegate method is called only once.
99
+ // call twice to verify the delegate method is called only once.
99
100
assertThat (cache .getDefaultDisplayNameGenerator ()).isSameAs (customDisplayNameGenerator );
100
101
assertThat (cache .getDefaultDisplayNameGenerator ()).isSameAs (customDisplayNameGenerator );
101
102
@@ -107,7 +108,7 @@ void cachesDefaultTestMethodOrderer() {
107
108
final Optional <MethodOrderer > methodOrderer = Optional .of (new MethodOrderer .MethodName ());
108
109
when (delegate .getDefaultTestMethodOrderer ()).thenReturn (methodOrderer );
109
110
110
- // call `cache.getDefaultTestMethodOrderer()` twice to verify the delegate method is called only once.
111
+ // call twice to verify the delegate method is called only once.
111
112
assertThat (cache .getDefaultTestMethodOrderer ()).isSameAs (methodOrderer );
112
113
assertThat (cache .getDefaultTestMethodOrderer ()).isSameAs (methodOrderer );
113
114
@@ -118,7 +119,7 @@ void cachesDefaultTestMethodOrderer() {
118
119
void cachesDefaultTempDirCleanupMode () {
119
120
when (delegate .getDefaultTempDirCleanupMode ()).thenReturn (NEVER );
120
121
121
- // call `cache.getDefaultTempStrategyDirCleanupMode()` twice to verify the delegate method is called only once.
122
+ // call twice to verify the delegate method is called only once.
122
123
assertThat (cache .getDefaultTempDirCleanupMode ()).isSameAs (NEVER );
123
124
assertThat (cache .getDefaultTempDirCleanupMode ()).isSameAs (NEVER );
124
125
@@ -130,13 +131,24 @@ void cachesDefaultTempDirFactorySupplier() {
130
131
Supplier <TempDirFactory > supplier = mock ();
131
132
when (delegate .getDefaultTempDirFactorySupplier ()).thenReturn (supplier );
132
133
133
- // call `cache.getDefaultTempDirFactorySupplier()` twice to verify the delegate method is called only once.
134
+ // call twice to verify the delegate method is called only once.
134
135
assertThat (cache .getDefaultTempDirFactorySupplier ()).isSameAs (supplier );
135
136
assertThat (cache .getDefaultTempDirFactorySupplier ()).isSameAs (supplier );
136
137
137
138
verify (delegate , only ()).getDefaultTempDirFactorySupplier ();
138
139
}
139
140
141
+ @ Test
142
+ void cachesDefaultLocaleConversionFormat () {
143
+ when (delegate .getDefaultLocaleConversionFormat ()).thenReturn (ISO_639 );
144
+
145
+ // call twice to verify the delegate method is called only once.
146
+ assertThat (cache .getDefaultLocaleConversionFormat ()).isSameAs (ISO_639 );
147
+ assertThat (cache .getDefaultLocaleConversionFormat ()).isSameAs (ISO_639 );
148
+
149
+ verify (delegate , only ()).getDefaultLocaleConversionFormat ();
150
+ }
151
+
140
152
@ Test
141
153
void doesNotCacheRawParameters () {
142
154
when (delegate .getRawConfigurationParameter ("foo" )).thenReturn (Optional .of ("bar" )).thenReturn (
0 commit comments