Releases: avaje/avaje-inject
8.3 | 7.3
Comments
This release adds great support for "component testing". I'll be updating the docs to reflect but there are 2 main things:
- There are 3 levels of scopes in testing - A Global scope (via
@TestScope
) used across all tests + Test class (forAll / static fields) scope + Test instance (forEach / instance fields). Most component tests will use 2 or 3 of these levels in a layering way (parent/child BeanScopes). - The junit5 InjectExtension has a Plugin API and I've used this with avaje-jex-test. This plugin API detects via types (e.g. http client type) if it should be part of a test and can create instances that get injected into the test. For example, with avaje-jex-test the plugin detects if a http client type is being injected and if so creates a http server using a random port + client, supplies the client to the test and at the end of the test scope shuts down the http server.
So with these features in place avaje-inject-test is now what I've wanted it to be wrt support of component testing. Docs and examples need some attention to reflect these features.
Cheers, Rob.
Issues
#213 - BUG: reference to Builder is ambiguous ... when injecting a class with simple name of Builder
#207 - Rename "with" methods with deprecate. e.g. migrate withBean() -> bean(), withSpy() -> spy()
#206 - Add BeanScope.builder() to replace BeanScope.newBuilder() with deprecation.
#202 - Can not apply Spy to a bean in the test scope bug
Enhancements
#214 - ENH: Add support for using @Prototype
on @Factory
@Bean
methods enhancement
#211 #212 - ENH: Add Plugin API for avaje-inject-test ... e.g. Inject a http client into a test and start/stop http server
#211 - ENH: Add Plugin API for avaje-inject-test ... e.g. Inject a http client into a test and start/stop http server
#208 #209 - Fix @InjectTest / InjectExtension to support static field injection
#203 #204 #205 - Add @InjectTest
+ TestScopeBean with helper methods to programmatically use the test scope
#204 - Add @InjectTest
as synonym for @ExtendWith(InjectExtension.class)
#203 - Add TestScopeBean as helper methods to programmatically use the test scope
8.2 | 7.2
8.1 | 7.1
8.0 | 7.0
6.22 | 5.22
6.21 | 5.21
#185 - ENH: Add BeanScope.getOptional(type) ... to more nicely handle programmatically getting optional dependencies
6.20 | 5.20
Issues:
#180 #182 - Static inner classes as dependencies bug
#179 #183 - List of implementing interfaces with generics - "No dependency provided" when injecting List or Set bug
#177 #178 - Bug when combining @Factory
with Generic Interface Type bug
Thanks @doppelrittberger for the bug reports and fixes !!
6.19 | 5.19
6.18 | 5.18
Enhancement
#174 - Add support for AOP Aspects