Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename ES testkit utility method #120

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,18 @@ public interface EventSourcedResult<R> {
*/
Object getUpdatedState();

/**
* @return Whether the command handler persist events or not.
* @deprecated Use {@link #didPersistEvents()} instead.
*/
@Deprecated(since = "3.0.2", forRemoval = true)
boolean didEmitEvents();

/**
* @return Whether the command handler persist events or not.
*/
boolean didPersistEvents();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should introduce such changes with a deprecation phase, even though it's "only" testkit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


/** @return All the events that were emitted by handling this command. */
List<Object> getAllEvents();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private[akka] final class EventSourcedResultImpl[R, S, E](

override def getUpdatedState: AnyRef = state.asInstanceOf[AnyRef]

override def didEmitEvents(): Boolean = !getAllEvents().isEmpty
override def didPersistEvents(): Boolean = !getAllEvents().isEmpty

override def getNextEventOfType[T](expectedClass: Class[T]): T =
if (!eventsIterator.hasNext) throw new NoSuchElementException("No more events found")
Expand All @@ -98,4 +98,6 @@ private[akka] final class EventSourcedResultImpl[R, S, E](
throw new NoSuchElementException(
"expected event type [" + expectedClass.getName + "] but found [" + next.getClass.getName + "]")
}

override def didEmitEvents(): Boolean = didPersistEvents()
}
Loading