Polish "Use constants for well-known scope names"
See gh-43065
This commit is contained in:
@@ -31,8 +31,8 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
@@ -74,7 +74,7 @@ public class JsonTestersAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
@ImportRuntimeHints(BasicJsonTesterRuntimeHints.class)
|
||||
public FactoryBean<BasicJsonTester> basicJsonTesterFactoryBean() {
|
||||
return new JsonTesterFactoryBean<BasicJsonTester, Void>(BasicJsonTester.class, null);
|
||||
@@ -85,7 +85,7 @@ public class JsonTestersAutoConfiguration {
|
||||
static class JacksonJsonTestersConfiguration {
|
||||
|
||||
@Bean
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
@ConditionalOnBean(ObjectMapper.class)
|
||||
@ImportRuntimeHints(JacksonTesterRuntimeHints.class)
|
||||
FactoryBean<JacksonTester<?>> jacksonTesterFactoryBean(ObjectMapper mapper) {
|
||||
@@ -107,7 +107,7 @@ public class JsonTestersAutoConfiguration {
|
||||
static class GsonJsonTestersConfiguration {
|
||||
|
||||
@Bean
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
@ConditionalOnBean(Gson.class)
|
||||
@ImportRuntimeHints(GsonTesterRuntimeHints.class)
|
||||
FactoryBean<GsonTester<?>> gsonTesterFactoryBean(Gson gson) {
|
||||
@@ -129,7 +129,7 @@ public class JsonTestersAutoConfiguration {
|
||||
static class JsonbJsonTesterConfiguration {
|
||||
|
||||
@Bean
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
@ConditionalOnBean(Jsonb.class)
|
||||
@ImportRuntimeHints(JsonbJsonTesterRuntimeHints.class)
|
||||
FactoryBean<JsonbTester<?>> jsonbTesterFactoryBean(Jsonb jsonb) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,6 +24,7 @@ import org.openqa.selenium.htmlunit.HtmlUnitDriver;
|
||||
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -63,7 +64,7 @@ class WebMvcTestWebDriverCustomScopeIntegrationTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
@Scope("singleton")
|
||||
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
|
||||
WebDriverFactory webDriver(MockMvc mockMvc) {
|
||||
return new WebDriverFactory(mockMvc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user