BewareMyPower commented on code in PR #1340:
URL: https://github.com/apache/pulsar-client-go/pull/1340#discussion_r1972840290
##########
pulsar/reader_test.go:
##########
@@ -1070,3 +1070,159 @@ func TestReaderNextReturnsOnClosedConsumer(t
*testing.T) {
assert.ErrorAs(t, err, &e)
assert.Equal(t, ConsumerClosed, e.Result())
}
+
+func testReaderSeekByIDWithHasNext(t *testing.T, startMessageID MessageID,
startMessageIDInclusive bool) {
+ client, err := NewClient(ClientOptions{
+ URL: lookupURL,
+ })
+
+ assert.Nil(t, err)
+ defer client.Close()
+
+ topic := newTopicName()
+ ctx := context.Background()
+
+ // create producer
+ producer, err := client.CreateProducer(ProducerOptions{
+ Topic: topic,
+ DisableBatching: true,
+ })
+ assert.Nil(t, err)
+ defer producer.Close()
+
+ // send 100 messages
+ var lastMsgID MessageID
+ for i := 0; i < 10; i++ {
+ lastMsgID, err = producer.Send(ctx, &ProducerMessage{
+ Payload: []byte(fmt.Sprintf("hello-%d", i)),
+ })
+ fmt.Println(lastMsgID.String())
Review Comment:
Don't use `fmt.Println` in tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]