Skip to content

Releases: avaje/avaje-inject

8.3 | 7.3

20 May 01:30
Compare
Choose a tag to compare

Comments

This release adds great support for "component testing". I'll be updating the docs to reflect but there are 2 main things:

  1. 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).
  2. 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

01 May 23:54
Compare
Choose a tag to compare

Issues

#200 #201 - ENH: Modify InjectExtension to support multiple TestModule
#199 - Bug: Missing import of method parameter type of aspect method. By @kevin70
#197 - Bug: isAddBeanFor() generated code includes package protected class and interface bug

8.1 | 7.1

26 Apr 00:56
Compare
Choose a tag to compare

Issues

#195 - Add @Component + @InjectModule(ignoreSingleton = true) ... additional approach co-exist with other DI libraries
#194 - Add @InjectModule requirePackages ... for better multi-module requires/provides
#193 - How do you depend on another module from another JAR?

8.0 | 7.0

22 Mar 04:41
Compare
Choose a tag to compare

Requires Java 11+

avaje-inject 8.x and 7.x now requires Java 11. Use earlier versions for Java 8 support, e.g. 6.22 or 5.22.

Issues:

#169 #190 - Bump to Java 11 and migrate to System.Logger from SLF4J-API
#156 - Dependency on SLF4J - Migrate to System.Logger

6.22 | 5.22

15 Mar 02:46
Compare
Choose a tag to compare

#188 - ENH: Add support for prototype scope (add @Prototype)
#189 - Change such that when using a Provider the provider controls the scope of the returned bean/instance

6.21 | 5.21

21 Feb 01:44
Compare
Choose a tag to compare

#185 - ENH: Add BeanScope.getOptional(type) ... to more nicely handle programmatically getting optional dependencies

6.20 | 5.20

24 Dec 00:08
Compare
Choose a tag to compare

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

21 Dec 23:34
Compare
Choose a tag to compare

Issues:

#175 - Interfaces with generic type parameters that extend other interfaces, don't PROVIDE those extended interfaces bug
#176 - Module interface lacks the classes() method breaking change

6.18 | 5.18

21 Dec 10:04
Compare
Choose a tag to compare

Enhancement

#174 - Add support for AOP Aspects

6.17 | 5.17

21 Dec 09:15
Compare
Choose a tag to compare

#171 #173 - Module (custom scope) dependencies aren't fully transitive bug
#164 - Gradle testAnnotationProcessor for classes under test bug