-
Notifications
You must be signed in to change notification settings - Fork 68
Add test cases to PulsarTemplateTests #38
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
Add test cases to PulsarTemplateTests #38
Conversation
* @return the id of the sent message | ||
* @throws PulsarClientException if an error occurs | ||
*/ | ||
default MessageId send(T message, MessageRouter messageRouter) throws PulsarClientException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this variant on the original proposal.
@@ -38,7 +38,7 @@ | |||
* @throws PulsarClientException if an error occurs | |||
*/ | |||
default MessageId send(T message) throws PulsarClientException { | |||
return send(null, message); | |||
return send(null, message, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made all of the default impls call to the abstract one rather than daisy-chan into the next most specific send
method. This prevents coupling between the different APIs (ie send(T message)
only depends on the abstract send(null, message, null);
whereas before it depended on send(null, message);
which then depended on send(null, message, null);
which then would mean that we have to consider all 3 when changing one of them. Basically 2 dependent function calls is less coupling than 3.
pulsarClient = PulsarClient.builder() | ||
.serviceUrl(getPulsarBrokerUrl()) | ||
.build(); | ||
} | ||
|
||
@AfterEach | ||
void closePulsarClient() throws PulsarClientException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[UNRELATED] I noticed this test was not cleaning up when done w/ the client.
* @author Soby Chacko | ||
* @author Chris Bono |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soby we can go over this one via Zoom if you like. It basically removes the "testUsage" test and replaces the 2 sync/async cases w/ the permutations of (syncOrAsync, defaultOrSpecificTopic, withOrWithoutRouter)
via @ParameterizedTest
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad @soby . Sorry for the interruption - have a nice day. 😸
LGTM - Merged upstream. |
This adds tests cases for the newly added
PulsarOperations
APIs.