Eventsourced entity testkit#584
Conversation
680121c to
17c9bf6
Compare
| current.reply.value shouldBe(42) | ||
|
|
||
| testKit.increase(eventsourcedentity.IncreaseValue(counterId, 15)) | ||
| val next = testKit.getCurrentCounter(eventsourcedentity.GetCounter(counterId)) |
There was a problem hiding this comment.
what is the thought around the naming "current" and "next"? Isn't it a "result", and here "result1" and "result2"?
| effect.javasdkEffect.secondaryEffect(state).isInstanceOf[ForwardReplyImpl[_]] | ||
|
|
||
| override def forwardedTo: ServiceCallDetails[R] = | ||
| ??? // FIXME |
There was a problem hiding this comment.
yeah, we should probably create a ticket for this (also for value entity)
| * INTERNAL API | ||
| */ | ||
| object EventSourcedResultImpl { | ||
| def eventsOf(effect: EventSourcedEntity.Effect[_]): Seq[Any] = { |
| override def isNoReply: Boolean = | ||
| effect.javasdkEffect.secondaryEffect(state).isInstanceOf[NoReply[_]] | ||
|
|
||
| override def updatedState: AnyRef = state.asInstanceOf[AnyRef] |
There was a problem hiding this comment.
can't we use S instead of AnyRef?
| effect.javasdkEffect.secondaryEffect(state).isInstanceOf[ForwardReplyImpl[_]] | ||
|
|
||
| override def forwardedTo: ServiceCallDetails[R] = | ||
| ??? // FIXME #587 |
There was a problem hiding this comment.
I wrote in 587 but, the context is already wired up with TestKitServiceCallFactory, so forwards will always be the Scala TestKitServiceCall and just matching should work fine here?
| } | ||
|
|
||
| private[scalasdk] final case class EventSourcedEntityEffectImpl[S]( | ||
| private[scalasdk] final case class EventSourcedEntityEffectImpl[R, S]( |
There was a problem hiding this comment.
So, R is the return type, when do we need state S as well, is that for the next step with thenReply?
There was a problem hiding this comment.
yeah, looks like we pass the state to the secondary effect callbacks, so it's nice to keep track of it with S
There was a problem hiding this comment.
I think I skipped it on the Java side because it became too noisy but here it seems nicely hidden. (Maybe I just didn't think of only doing it to the impl side)
Part of #372
Still needs:
nextEventOfTypetype