safety-data / akka-persistence-redis

Akka persistence plugin for Redis
Apache License 2.0
27 stars 13 forks source link

ScalaReadJournal cannot be instantiated in a test #12

Open sidsethupathi opened 7 years ago

sidsethupathi commented 7 years ago

https://github.com/safety-data/akka-persistence-redis/blob/897f31698a9c61fbb19eeef5135dfdd2a090b2b4/src/main/scala/akka/persistence/query/journal/redis/ScalaReadJournal.scala#L36

Is this private[redis] intentional? I'm attempting to stub out my read journal in my application tests but this seems to be preventing me from doing so.

[error] AppActorTest.scala:16: constructor ScalaReadJournal in class ScalaReadJournal cannot be accessed in <$anon: akka.persistence.query.journal.redis.ScalaReadJournal>
[error]   val stubbedReadJournal: ScalaReadJournal = new ScalaReadJournal {
[error]                                                  ^
[error] one error found
satabin commented 7 years ago

HI,

Actually it is because the canonical way for instantiating it is to use the ReadJournalProvider here

Can’t you stub this in your tests?