Finatra v2.9.0 Release Notes
-
โ Added
๐ Changed
- inject-core: (BREAKING API CHANGE) Allow for binding of higher-kinded
types when testing. Deprecated
@Bind
mechanism for replacing bound types in an object graph. Now instead of using@Bind
like this:
::
class DarkTrafficCanonicalResourceHeaderTest extends FeatureTest with Mockito { @Bind @DarkTrafficService val darkTrafficService: Option[Service[Request, Response]] = Some(smartMock[Service[Request, Response]]) /* mock request */ darkTrafficService.get.apply(any[Request]).returns(Future.value(smartMock[Response])) override val server = new EmbeddedHttpServer( twitterServer = new DarkTrafficTestServer) test("DarkTrafficServer#has Canonical-Resource header correctly set") { ...
Users can instead do:
::
class DarkTrafficCanonicalResourceHeaderTest extends FeatureTest with Mockito { val darkTrafficService: Option[Service[Request, Response]] = Some(smartMock[Service[Request, Response]]) /* mock request */ darkTrafficService.get.apply(any[Request]).returns(Future.value(smartMock[Response])) override val server = new EmbeddedHttpServer( twitterServer = new DarkTrafficTestServer) .bind[Option[Service[Request, Response]], DarkTrafficService](darkTrafficService) test("DarkTrafficServer#has Canonical-Resource header correctly set") { ...
This allows for more flexibility (as the binding is now per object graph, rather than per test files) and is less susceptible to errors due to incorrect usage.
The breaking API change is due to adding this support in the TestInjector, it is now required that users call the
TestInjector#create
method in order to build the injector and that this is done after calls toTestInjector#bind
. Previously, anInjector
was directly returned fromTestInjector#apply
which is no longer true, thus it may look like your IntegrationTests are broken as you now need to add a call toTestInjector#create
.Additionally, this change updates all of the framework tests in the inject modules to the FunSuite testing style from the deprecated WordSpec testing style.
RB_ID=910011
โก๏ธ finatra-thrift: Update framework tests to FunSuite ScalaTest testing style.
RB_ID=910262
๐ inject-core: Move Logging from grizzled-slf4j to util/util-slf4j-api.
c.t.inject.Logger
is now deprecated in favor ofc.t.util.logging.Logger
in util.PHAB_ID=D29713
โก๏ธ finatra-httpclient: Update framework tests to FunSuite ScalaTest testing style.
RB_ID=909526
โก๏ธ finatra-http: Update framework tests to FunSuite ScalaTest testing style.
RB_ID=909349
finatra: Bump guava to 19.0.
RB_ID=907807
inject-thrift-client: Various APIs have changed to work with
ThriftMethod.SuccessType
instead ofThriftMethod.Result
. SeeThriftClientFilterChain
,Controller
,ThriftWarmup
,PossiblyRetryable
.RB_ID=908846
๐ Fixed
* ๐ finatra-http: Correctly support adding Java AbstractController by instance. ``RB_ID=910502`` Closed
- inject-core: (BREAKING API CHANGE) Allow for binding of higher-kinded
types when testing. Deprecated