Comments (4)
to register beans on the context and take advantage of test classes @Autowired support for example
If Spring Fu built on top of Boot, which I think it should, you'd benefit from the change that's currently proposed in spring-projects/spring-boot#8115 (comment). Note the custom BeanDefinitionLoader
in the repository that @dsyer links to in his comment.
from spring-fu.
Since Spring Fu is heavily based on
ApplicationContextInitializer
, is there something already supported inSpringExtension
we could leverage to register beans on the context and take advantage of test classes@Autowired
support for example?
Sure, there are two major options here.
You can register an ApplicationContextInitializer
via @ContextConfiguration(initializers = ...)
.
You can make use of an auto-detected ContextCustomizer
. That's actually what Spring Boot Test does, and it was the original PR from @philwebb that got that into the Spring TestContext Framework.
Using an ApplicationContextInitializer
would typically require that the end user register it explicitly for each test class; whereas, a ContextCustomizer
can be registered automatically by the Spring Fu framework.
These features are of course not specific to JUnit Jupiter. Only the support for constructor and method injection of such beans would be specific to the SpringExtension
.
Does one of those options work for you?
from spring-fu.
Thanks for your feedback @wilkinsona and @sbrannen, we are going to try to leverage Boot for that indeed.
from spring-fu.
Typical Spring Fu tests are just plain JUnit 5 tests + Spring Fu is now based on Boot so I close this issue.
from spring-fu.
Related Issues (20)
- Upgrade to Spring Boot 2.4.4
- Rename master `branch` to `main`
- Upgrade to Spring Boot 2.5.1
- Ability to create endpoints/routes dynamically (IE and endpoint creating another endpoint at runtime)?
- enable function is protected HOT 1
- spring-boot-autoconfigure conflit HOT 1
- Cannot extend Kotlin DSL HOT 1
- Upgrade to Spring Boot 2.5.3
- CoroutineCrudRepository issue
- Spring Native compatibility HOT 1
- Is the project discontinued? HOT 4
- [question] is Spring Fu production ready? HOT 1
- Upgrade to Spring Boot 2.6
- Build uses jcenter() which is deprecated and will be removed in Gradle 8
- Spring Kofu 0.5.0 issue with Spring Native HOT 1
- Project timeline HOT 2
- Upgrade to Spring Boot 2.6.6
- R2dbc H2 does not work with Spring Boot 2.7 HOT 1
- Activate Autoconfiguration for certain external dependencies HOT 1
- Spring Boot 3.0.0 seems to break kofu HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-fu.