akka-projection icon indicating copy to clipboard operation
akka-projection copied to clipboard

Supported projection implementation handler types should be added to TestProjection

Open seglo opened this issue 4 years ago • 3 comments

Short description

The TestProjection currently only supports simple Handler.process types which have a Envelope => Future[Done] signature. Support for Slick and JDBC handler types should be added.

seglo avatar Sep 14 '20 16:09 seglo

I think we need customer request for this before expanding the Slick support. Main reason for Slick support was to support migration for Lagom users, and TestProjection is probably not essential for that.

patriknw avatar Sep 15 '20 10:09 patriknw

Hi! Has anything regarding this topic changed? Or you still don't see enough demand for this to be implemented?

DcortezMeleth avatar Jul 16 '21 05:07 DcortezMeleth

@DcortezMeleth, it seems that there is not much interest in that feature.

On top of that, I see another issue with Slick. The handler has the shape Envelope => DBIO[Done]. That means that we will need to have an in-memory interpreted for DBIO to transform it to Future. Not impossible, it's just a non-trivial task.

That said, I think the easiest way to test it is to use a test database (like h2) and wrap the Slick handler you want to test with a Envelope => Future[Done] handler. The wrapper handler would then run the DBIO against the h2 db.

octonato avatar Jul 16 '21 07:07 octonato