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