[refactor][test] Use logger to print log
### Motivation
Need to use the logger to print logs in the unit test.
### Modifications
* Use logger instead of `System.out`.
@@ -270,7 +270,7 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
// 1) produce numberOfMessages message to pulsar
for (int i = 0; i < numberOfMessages; i++) {
- System.out.println(producer.send(new byte[10]));
+ log.info("Produce messages: " + producer.send(new byte[10]).toString());
}
// 2) Create a subscription from earliest position
@@ -288,7 +288,7 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
verify(response, timeout(5000).times(1)).resume(statCaptor.capture());
TopicStats topicStats = statCaptor.getValue();
long msgBacklog = topicStats.getSubscriptions().get(SUB_EARLIEST).getMsgBacklog();
- System.out.println("Message back log for " + SUB_EARLIEST + " is :" + msgBacklog);
+ log.info("Message back log for " + SUB_EARLIEST + " is :" + msgBacklog);
Assert.assertEquals(msgBacklog, numberOfMessages);
// 3) Create a subscription with form latest position
@@ -306,7 +306,7 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
verify(response, timeout(5000).times(1)).resume(statCaptor.capture());
topicStats = statCaptor.getValue();
msgBacklog = topicStats.getSubscriptions().get(SUB_LATEST).getMsgBacklog();
- System.out.println("Message back log for " + SUB_LATEST + " is :" + msgBacklog);
+ log.info("Message back log for " + SUB_LATEST + " is :" + msgBacklog);
Assert.assertEquals(msgBacklog, 0);
// 4) Create a subscription without position
@@ -324,7 +324,7 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
verify(response, timeout(5000).times(1)).resume(statCaptor.capture());
topicStats = statCaptor.getValue();
msgBacklog = topicStats.getSubscriptions().get(SUB_NONE_MESSAGE_ID).getMsgBacklog();
- System.out.println("Message back log for " + SUB_NONE_MESSAGE_ID + " is :" + msgBacklog);
+ log.info("Message back log for " + SUB_NONE_MESSAGE_ID + " is :" + msgBacklog);
Assert.assertEquals(msgBacklog, 0);
// 5) Create replicated subscription
