Finatra release 2.9.0 is available from Maven Central.
We highly recommend looking through the CHANGELOG for a full rundown of all the changes and fixes.
Scala 2.12 Support
Move from grizzled-slf4j to util-slf4j-api
This change should be transparent to end users.
bind[T] testing DSL
We introduced an alternative to using the
@Bind binding annotation for binding fields in an integration test (which we call the
bind[T] DSL) which is exposed on all the testing utilities:
While useful, using
@Bind during testing for overriding bound instances in the object graph has several practical drawbacks that we wanted to address. Specifically, two main issues.
First, any field that accesses the embedded server or application needs to be lazy (or defined within a test method) such that the
@Bind mechanism has time to replace the corresponding type in the object graph on server startup. Eager access to the embedded server or application negates the ability of
@Bind to function.
Second, the type being bound with
@Bind needs to exactly match a type in the object graph in order to replace it (otherwise you would simply be binding a new type). While a simple thing to solve, (by specifying the type on a val) it nonetheless contributes to incorrect usage. The
bind[T] DSL is more explicit in this regards.
In this release, we’ve updated the
bind[T] DSL to allow binding higher-kinded types which should remove any roadblocks for its wider adoption. Using
@Bind should now be considered deprecated.
Important (or why do my tests seem broken)
To support the
bind[T] DSL in the
c.t.inject.app.TestInjector we have updated the lifecycle of the TestInjector. Previously, a
c.google.inject.Injector was returned directly from the
TestInjector#apply method. The concrete consequence of the change is that you must now call
TestInjector#create to return a
Without adding this your tests which use a
TestInjector may appear to be broken.