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

use [jms-testkit] in JMS unit tests #1401

Merged
merged 1 commit into from
Jan 16, 2019
Merged

use [jms-testkit] in JMS unit tests #1401

merged 1 commit into from
Jan 16, 2019

Conversation

sullis
Copy link
Contributor

@sullis sullis commented Dec 27, 2018

No description provided.

@sullis
Copy link
Contributor Author

sullis commented Dec 29, 2018

ready for review

@sullis
Copy link
Contributor Author

sullis commented Jan 3, 2019

Ready for review.

@ennru
Copy link
Member

ennru commented Jan 3, 2019

Thank you for your suggestion to factor this out.

I'm a bit reluctant to pull in your library, though. I don't see a huge improvement for the Alpakka JMS tests and this change could easily be made in the tests without a new test depenency.

Can you explain why this needs to be in an external library?

@ennru ennru added the p:jms label Jan 3, 2019
@sullis
Copy link
Contributor Author

sullis commented Jan 8, 2019

This PR removes a significant amount of boilerplate code.

[jms-testkit] provides a concise API. The API was designed specifically for writing unit tests.

=> setting up an in-memory broker is 1 line: val broker = JmsBroker()
=> setting up an in-memory queue is 1 line: val queue = JmsQueue()
=> publishing a message is 1 line: queue.publishMessage("hello")
=> inspecting the contents of the queue is 1 line: queue.toSeq

Btw, [jms-testkit] is used by the [fs2-jms] library:

https://github.com/kiambogo/fs2-jms/blob/master/src/test/scala/ProducerSpec.scala#L32

Copy link
Member

@2m 2m left a comment

Choose a reason for hiding this comment

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

LGTM

@2m 2m merged commit 5ff58eb into akka:master Jan 16, 2019
@2m 2m added this to the 1.0-M2 milestone Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants