Polish
This commit is contained in:
@@ -351,16 +351,13 @@ public abstract class AbstractApplicationContextRunner<SELF extends AbstractAppl
|
||||
* @param consumer the consumer of the created {@link ApplicationContext}
|
||||
* @return this instance
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public SELF run(ContextConsumer<? super A> consumer) {
|
||||
withContextClassLoader(this.classLoader, () -> {
|
||||
this.systemProperties.applyToSystemProperties(() -> {
|
||||
try (A context = createAssertableContext()) {
|
||||
accept(consumer, context);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
});
|
||||
withContextClassLoader(this.classLoader, () -> this.systemProperties.applyToSystemProperties(() -> {
|
||||
try (A context = createAssertableContext()) {
|
||||
accept(consumer, context);
|
||||
}
|
||||
return null;
|
||||
}));
|
||||
return (SELF) this;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
@@ -307,7 +308,7 @@ public class MockitoPostProcessor extends InstantiationAwareBeanPostProcessorAda
|
||||
if (primaryBeanName != null) {
|
||||
throw new NoUniqueBeanDefinitionException(type.resolve(), candidateBeanNames.size(),
|
||||
"more than one 'primary' bean found among candidates: "
|
||||
+ Arrays.asList(candidateBeanNames));
|
||||
+ Collections.singletonList(candidateBeanNames));
|
||||
}
|
||||
primaryBeanName = candidateBeanName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user