43
43
import static org .assertj .core .api .Assertions .assertThat ;
44
44
import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
45
45
import static org .mockito .ArgumentMatchers .any ;
46
+ import static org .mockito .ArgumentMatchers .anyBoolean ;
46
47
import static org .mockito .ArgumentMatchers .eq ;
47
48
import static org .mockito .BDDMockito .given ;
48
49
import static org .mockito .Mockito .mock ;
@@ -119,7 +120,7 @@ void withProcessedImportsResolvesAndLoads() {
119
120
Map <ConfigDataResolutionResult , ConfigData > imported = new LinkedHashMap <>();
120
121
imported .put (new ConfigDataResolutionResult (LOCATION_1 , new TestConfigDataResource ("a" ), false ),
121
122
new ConfigData (Arrays .asList (propertySource )));
122
- given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (locations )))
123
+ given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (locations ), anyBoolean () ))
123
124
.willReturn (imported );
124
125
ConfigDataEnvironmentContributor contributor = ConfigDataEnvironmentContributor .ofInitialImport (LOCATION_1 );
125
126
ConfigDataEnvironmentContributors contributors = new ConfigDataEnvironmentContributors (this .logFactory ,
@@ -142,14 +143,14 @@ void withProcessedImportsResolvesAndLoadsChainedImports() {
142
143
Map <ConfigDataResolutionResult , ConfigData > initialImported = new LinkedHashMap <>();
143
144
initialImported .put (new ConfigDataResolutionResult (LOCATION_1 , new TestConfigDataResource ("a" ), false ),
144
145
new ConfigData (Arrays .asList (initialPropertySource )));
145
- given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (initialLocations )))
146
- .willReturn (initialImported );
146
+ given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (initialLocations ),
147
+ anyBoolean ())) .willReturn (initialImported );
147
148
List <ConfigDataLocation > secondLocations = Arrays .asList (LOCATION_2 );
148
149
MockPropertySource secondPropertySource = new MockPropertySource ();
149
150
Map <ConfigDataResolutionResult , ConfigData > secondImported = new LinkedHashMap <>();
150
151
secondImported .put (new ConfigDataResolutionResult (LOCATION_2 , new TestConfigDataResource ("b" ), false ),
151
152
new ConfigData (Arrays .asList (secondPropertySource )));
152
- given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (secondLocations )))
153
+ given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (secondLocations ), anyBoolean () ))
153
154
.willReturn (secondImported );
154
155
ConfigDataEnvironmentContributor contributor = ConfigDataEnvironmentContributor .ofInitialImport (LOCATION_1 );
155
156
ConfigDataEnvironmentContributors contributors = new ConfigDataEnvironmentContributors (this .logFactory ,
@@ -176,13 +177,13 @@ void withProcessedImportsProvidesLocationResolverContextWithAccessToBinder() {
176
177
Map <ConfigDataResolutionResult , ConfigData > imported = new LinkedHashMap <>();
177
178
imported .put (new ConfigDataResolutionResult (LOCATION_1 , new TestConfigDataResource ("a'" ), false ),
178
179
new ConfigData (Arrays .asList (propertySource )));
179
- given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (locations )))
180
+ given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (locations ), anyBoolean () ))
180
181
.willReturn (imported );
181
182
ConfigDataEnvironmentContributor contributor = ConfigDataEnvironmentContributor .ofInitialImport (LOCATION_1 );
182
183
ConfigDataEnvironmentContributors contributors = new ConfigDataEnvironmentContributors (this .logFactory ,
183
184
this .bootstrapContext , Arrays .asList (existingContributor , contributor ));
184
185
contributors .withProcessedImports (this .importer , this .activationContext );
185
- verify (this .importer ).resolveAndLoad (any (), this .locationResolverContext .capture (), any (), any ());
186
+ verify (this .importer ).resolveAndLoad (any (), this .locationResolverContext .capture (), any (), any (), anyBoolean () );
186
187
ConfigDataLocationResolverContext context = this .locationResolverContext .getValue ();
187
188
assertThat (context .getBinder ().bind ("test" , String .class ).get ()).isEqualTo ("springboot" );
188
189
}
@@ -196,20 +197,21 @@ void withProcessedImportsProvidesLocationResolverContextWithAccessToParent() {
196
197
Map <ConfigDataResolutionResult , ConfigData > initialImported = new LinkedHashMap <>();
197
198
initialImported .put (new ConfigDataResolutionResult (LOCATION_1 , new TestConfigDataResource ("a" ), false ),
198
199
new ConfigData (Arrays .asList (initialPropertySource )));
199
- given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (initialLocations )))
200
- .willReturn (initialImported );
200
+ given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (initialLocations ),
201
+ anyBoolean ())) .willReturn (initialImported );
201
202
List <ConfigDataLocation > secondLocations = Arrays .asList (LOCATION_2 );
202
203
MockPropertySource secondPropertySource = new MockPropertySource ();
203
204
Map <ConfigDataResolutionResult , ConfigData > secondImported = new LinkedHashMap <>();
204
205
secondImported .put (new ConfigDataResolutionResult (LOCATION_2 , new TestConfigDataResource ("b" ), false ),
205
206
new ConfigData (Arrays .asList (secondPropertySource )));
206
- given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (secondLocations )))
207
+ given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (secondLocations ), anyBoolean () ))
207
208
.willReturn (secondImported );
208
209
ConfigDataEnvironmentContributor contributor = ConfigDataEnvironmentContributor .ofInitialImport (LOCATION_1 );
209
210
ConfigDataEnvironmentContributors contributors = new ConfigDataEnvironmentContributors (this .logFactory ,
210
211
this .bootstrapContext , Arrays .asList (contributor ));
211
212
contributors .withProcessedImports (this .importer , this .activationContext );
212
- verify (this .importer ).resolveAndLoad (any (), this .locationResolverContext .capture (), any (), eq (secondLocations ));
213
+ verify (this .importer ).resolveAndLoad (any (), this .locationResolverContext .capture (), any (), eq (secondLocations ),
214
+ anyBoolean ());
213
215
ConfigDataLocationResolverContext context = this .locationResolverContext .getValue ();
214
216
assertThat (context .getParent ()).hasToString ("a" );
215
217
}
@@ -226,13 +228,13 @@ void withProcessedImportsProvidesLocationResolverContextWithAccessToBootstrapReg
226
228
Map <ConfigDataResolutionResult , ConfigData > imported = new LinkedHashMap <>();
227
229
imported .put (new ConfigDataResolutionResult (LOCATION_1 , new TestConfigDataResource ("a'" ), false ),
228
230
new ConfigData (Arrays .asList (propertySource )));
229
- given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (locations )))
231
+ given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (locations ), anyBoolean () ))
230
232
.willReturn (imported );
231
233
ConfigDataEnvironmentContributor contributor = ConfigDataEnvironmentContributor .ofInitialImport (LOCATION_1 );
232
234
ConfigDataEnvironmentContributors contributors = new ConfigDataEnvironmentContributors (this .logFactory ,
233
235
this .bootstrapContext , Arrays .asList (existingContributor , contributor ));
234
236
contributors .withProcessedImports (this .importer , this .activationContext );
235
- verify (this .importer ).resolveAndLoad (any (), this .locationResolverContext .capture (), any (), any ());
237
+ verify (this .importer ).resolveAndLoad (any (), this .locationResolverContext .capture (), any (), any (), anyBoolean () );
236
238
ConfigDataLocationResolverContext context = this .locationResolverContext .getValue ();
237
239
assertThat (context .getBootstrapContext ()).isSameAs (this .bootstrapContext );
238
240
}
@@ -249,13 +251,13 @@ void withProcessedImportsProvidesLoaderContextWithAccessToBootstrapRegistry() {
249
251
Map <ConfigDataResolutionResult , ConfigData > imported = new LinkedHashMap <>();
250
252
imported .put (new ConfigDataResolutionResult (LOCATION_1 , new TestConfigDataResource ("a'" ), false ),
251
253
new ConfigData (Arrays .asList (propertySource )));
252
- given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (locations )))
254
+ given (this .importer .resolveAndLoad (eq (this .activationContext ), any (), any (), eq (locations ), anyBoolean () ))
253
255
.willReturn (imported );
254
256
ConfigDataEnvironmentContributor contributor = ConfigDataEnvironmentContributor .ofInitialImport (LOCATION_1 );
255
257
ConfigDataEnvironmentContributors contributors = new ConfigDataEnvironmentContributors (this .logFactory ,
256
258
this .bootstrapContext , Arrays .asList (existingContributor , contributor ));
257
259
contributors .withProcessedImports (this .importer , this .activationContext );
258
- verify (this .importer ).resolveAndLoad (any (), any (), this .loaderContext .capture (), any ());
260
+ verify (this .importer ).resolveAndLoad (any (), any (), this .loaderContext .capture (), any (), anyBoolean () );
259
261
ConfigDataLoaderContext context = this .loaderContext .getValue ();
260
262
assertThat (context .getBootstrapContext ()).isSameAs (this .bootstrapContext );
261
263
}
0 commit comments