From 643d5f3521406fe188f7c3c7e255d9b99ddb85e9 Mon Sep 17 00:00:00 2001 From: James Robertson Date: Mon, 14 Nov 2022 11:58:07 +0000 Subject: [PATCH] remove logs from samples --- .../announcements/src/main/java/Announcements.java | 8 ++++---- .../src/test/java/AnnouncementsTest.java | 4 ++-- .../authentication/src/main/java/Authentication.java | 4 ++-- .../src/test/java/AuthenticationTest.java | 2 +- .../message-count/src/main/java/MessageCount.java | 6 +++--- .../src/test/java/MessageCountTest.java | 6 +++--- samples/moderation/src/main/java/Moderate.java | 10 +++++----- samples/moderation/src/test/java/ModerationTest.java | 4 ++-- .../send-messages/src/main/java/SendMessages.java | 12 ++++++------ .../src/main/java/UserManagement.java | 2 +- .../src/test/java/UserManagementTest.java | 2 +- 11 files changed, 30 insertions(+), 30 deletions(-) diff --git a/samples/announcements/src/main/java/Announcements.java b/samples/announcements/src/main/java/Announcements.java index 4a046dd9..36b4613e 100644 --- a/samples/announcements/src/main/java/Announcements.java +++ b/samples/announcements/src/main/java/Announcements.java @@ -109,7 +109,7 @@ class User { String apiToken; UserApi apiInstance; public User(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new UserApi(defaultClient); apiToken = Config.apiToken; @@ -170,7 +170,7 @@ class Announcement { AnnouncementApi apiInstance; public Announcement(ApiClient defaultClient) { - System.out.println("constructor"); + apiInstance = new AnnouncementApi(defaultClient); apiToken = Config.apiToken; } @@ -192,11 +192,11 @@ public ScheduleAnnouncementResponse scheduleAnnouncement(String message, String scheduleAnnouncementData.targetList(targetList); scheduleAnnouncementData.targetChannelType(channelType); - System.out.println(scheduleAnnouncementData); + scheduleAnnouncementData); try { ScheduleAnnouncementResponse result = apiInstance.scheduleAnnouncement().apiToken(apiToken).scheduleAnnouncementData(scheduleAnnouncementData).execute(); - System.out.println(result); + result); } catch (ApiException e) { System.err.println("Exception when calling MessageApi#scheduleAnnouncement"); System.err.println("Status code: " + e.getCode()); diff --git a/samples/announcements/src/test/java/AnnouncementsTest.java b/samples/announcements/src/test/java/AnnouncementsTest.java index a5fb85b8..2f22059e 100644 --- a/samples/announcements/src/test/java/AnnouncementsTest.java +++ b/samples/announcements/src/test/java/AnnouncementsTest.java @@ -20,7 +20,7 @@ void testSendAnnouncement() { @AfterAll public static void tearDown() { - System.out.println("AbstractBaseTest.tearDown"); + "AbstractBaseTest.tearDown"); ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api-"+Config.appId+".sendbird.com"); @@ -34,7 +34,7 @@ public static void tearDown() { } GcListChannelsResponse groupChannelResponse = groupChannel.listChannels("SB::test-gc::Java::e2e::"); - System.out.println(groupChannelResponse); + groupChannelResponse); for (int i = 0; i < groupChannelResponse.getChannels().size(); i++) { String channelUrlToDelete = groupChannelResponse.getChannels().get(i).getChannelUrl(); diff --git a/samples/authentication/src/main/java/Authentication.java b/samples/authentication/src/main/java/Authentication.java index 2f6aac3c..576f9d8a 100644 --- a/samples/authentication/src/main/java/Authentication.java +++ b/samples/authentication/src/main/java/Authentication.java @@ -14,7 +14,7 @@ public void generateSessionToken(){ SendBirdUser createUserResultA = user.createUser(); CreateUserTokenResponse result = user.createSessionToken(createUserResultA.getUserId()); - System.out.println(result); + result); } } @@ -23,7 +23,7 @@ class User { String apiToken; UserApi apiInstance; public User(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new UserApi(defaultClient); apiToken = Config.apiToken; diff --git a/samples/authentication/src/test/java/AuthenticationTest.java b/samples/authentication/src/test/java/AuthenticationTest.java index f0ad505e..1d23c12e 100644 --- a/samples/authentication/src/test/java/AuthenticationTest.java +++ b/samples/authentication/src/test/java/AuthenticationTest.java @@ -20,7 +20,7 @@ void testGenerateSessionToken() { @AfterAll public static void tearDown() { - System.out.println("AbstractBaseTest.tearDown"); + "AbstractBaseTest.tearDown"); ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api-"+Config.appId+".sendbird.com"); User user = new User(defaultClient); diff --git a/samples/message-count/src/main/java/MessageCount.java b/samples/message-count/src/main/java/MessageCount.java index f8530d03..810ff567 100644 --- a/samples/message-count/src/main/java/MessageCount.java +++ b/samples/message-count/src/main/java/MessageCount.java @@ -30,7 +30,7 @@ public BigDecimal countUnreadMessages(){ SendBirdMessageResponse result = message.sendMessage("group_channels",createChannelResult.getChannelUrl(), createUserResultB.getUserId(), "yo", "MESG"); GcViewNumberOfEachMembersUnreadMessagesResponse unreadMessages = message.membersUnreadMessageCount(createChannelResult.getChannelUrl(), createUserResultA.getUserId()); - System.out.println(unreadMessages); + unreadMessages); return unreadMessages.getUnread().get(createUserResultA.getUserId()); } } @@ -111,7 +111,7 @@ class User { String apiToken; UserApi apiInstance; public User(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new UserApi(defaultClient); apiToken = Config.apiToken; @@ -188,7 +188,7 @@ public SendBirdMessageResponse sendMessage(String channelType, String channelUrl try { SendBirdMessageResponse result = apiInstance.sendMessage(channelType, channelUrl).apiToken(apiToken).sendMessageData(sendMessageData).execute(); - System.out.println(result); + result); return result; } catch (ApiException e) { System.err.println("Exception when calling MessageApi#sendMessage"); diff --git a/samples/message-count/src/test/java/MessageCountTest.java b/samples/message-count/src/test/java/MessageCountTest.java index 637a57e0..92065617 100644 --- a/samples/message-count/src/test/java/MessageCountTest.java +++ b/samples/message-count/src/test/java/MessageCountTest.java @@ -17,14 +17,14 @@ class MessageCountTest { void testCountUnreadMessages() { MessageCount messageCount = new MessageCount(); BigDecimal unreadCount = messageCount.countUnreadMessages(); - System.out.println(unreadCount); + unreadCount); assertEquals(unreadCount, BigDecimal.ONE); } @AfterAll public static void tearDown() { - System.out.println("AbstractBaseTest.tearDown"); + "AbstractBaseTest.tearDown"); ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api-"+Config.appId+".sendbird.com"); User user = new User(defaultClient); @@ -34,7 +34,7 @@ public static void tearDown() { for (int i = 0; i < users.getUsers().size(); i++) { String userIdToDelete = users.getUsers().get(i).getUserId(); - System.out.println(userIdToDelete); + userIdToDelete); user.deleteUserById(userIdToDelete); } diff --git a/samples/moderation/src/main/java/Moderate.java b/samples/moderation/src/main/java/Moderate.java index c3ce71c6..79f8012e 100644 --- a/samples/moderation/src/main/java/Moderate.java +++ b/samples/moderation/src/main/java/Moderate.java @@ -130,7 +130,7 @@ class User { String apiToken; UserApi apiInstance; public User(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new UserApi(defaultClient); apiToken = Config.apiToken; @@ -193,7 +193,7 @@ class Message { String apiToken; MessageApi apiInstance; public Message(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new MessageApi(defaultClient); apiToken = Config.apiToken; @@ -210,7 +210,7 @@ public SendBirdMessageResponse sendMessage(String channelType, String channelUrl try { SendBirdMessageResponse result = apiInstance.sendMessage(channelType, channelUrl).apiToken(apiToken).sendMessageData(sendMessageData).execute(); - System.out.println(result); + result); return result; } catch (ApiException e) { System.err.println("Exception when calling MessageApi#sendMessage"); @@ -230,7 +230,7 @@ class Moderation { String apiToken; ModerationApi apiInstance; public Moderation(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new ModerationApi(defaultClient); apiToken = Config.apiToken; @@ -258,7 +258,7 @@ class Report { String apiToken; ReportApi apiInstance; public Report(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new ReportApi(defaultClient); apiToken = Config.apiToken; diff --git a/samples/moderation/src/test/java/ModerationTest.java b/samples/moderation/src/test/java/ModerationTest.java index 064a97b0..2be48809 100644 --- a/samples/moderation/src/test/java/ModerationTest.java +++ b/samples/moderation/src/test/java/ModerationTest.java @@ -25,7 +25,7 @@ void testReportMessage() { @AfterAll public static void tearDown() { - System.out.println("AbstractBaseTest.tearDown"); + "AbstractBaseTest.tearDown"); ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api-"+Config.appId+".sendbird.com"); User user = new User(defaultClient); @@ -38,7 +38,7 @@ public static void tearDown() { } GcListChannelsResponse groupChannelResponse = groupChannel.listChannels("SB::test-gc::Java::e2e::"); - System.out.println(groupChannelResponse); + groupChannelResponse); for (int i = 0; i < groupChannelResponse.getChannels().size(); i++) { String channelUrlToDelete = groupChannelResponse.getChannels().get(i).getChannelUrl(); diff --git a/samples/send-messages/src/main/java/SendMessages.java b/samples/send-messages/src/main/java/SendMessages.java index fce2980b..b35f5a99 100644 --- a/samples/send-messages/src/main/java/SendMessages.java +++ b/samples/send-messages/src/main/java/SendMessages.java @@ -58,7 +58,7 @@ public void sendFileMessage(){ // active premium in Sendbird dashboard SendBirdMessageResponse result = message.sendFileMessage("group_channels",createChannelResult.getChannelUrl(),createUserResultA.getUserId(), "yo", "FILE"); - System.out.println("send announcment"); + "send announcment"); } } @@ -107,7 +107,7 @@ class User { String apiToken; UserApi apiInstance; public User(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new UserApi(defaultClient); apiToken = Config.apiToken; @@ -137,7 +137,7 @@ class Message { String apiToken; MessageApi apiInstance; public Message(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new MessageApi(defaultClient); apiToken = Config.apiToken; @@ -151,11 +151,11 @@ public SendBirdMessageResponse sendMessage(String channelType, String channelUrl sendMessageData.userId(userId); sendMessageData.message(message); sendMessageData.messageType(messageType); - System.out.println(sendMessageData); + sendMessageData); try { SendBirdMessageResponse result = apiInstance.sendMessage(channelType, channelUrl).apiToken(apiToken).sendMessageData(sendMessageData).execute(); - System.out.println(result); + result); return result; } catch (ApiException e) { System.err.println("Exception when calling MessageApi#sendMessage"); @@ -180,7 +180,7 @@ public SendBirdMessageResponse sendFileMessage(String channelType, String channe try { SendBirdMessageResponse result = apiInstance.sendMessage(channelType, channelUrl).apiToken(apiToken).sendMessageData(sendMessageData).execute(); - System.out.println(result); + result); } catch (ApiException e) { System.err.println("Exception when calling MessageApi#sendMessage"); System.err.println("Status code: " + e.getCode()); diff --git a/samples/user-management/src/main/java/UserManagement.java b/samples/user-management/src/main/java/UserManagement.java index 2c2c11c9..406135ab 100644 --- a/samples/user-management/src/main/java/UserManagement.java +++ b/samples/user-management/src/main/java/UserManagement.java @@ -26,7 +26,7 @@ class User { String apiToken; UserApi apiInstance; public User(ApiClient defaultClient){ - System.out.println("constructor"); + apiInstance = new UserApi(defaultClient); apiToken = Config.apiToken; diff --git a/samples/user-management/src/test/java/UserManagementTest.java b/samples/user-management/src/test/java/UserManagementTest.java index f90f7db6..663ffc4d 100644 --- a/samples/user-management/src/test/java/UserManagementTest.java +++ b/samples/user-management/src/test/java/UserManagementTest.java @@ -19,7 +19,7 @@ void testManageUser() { UserManagement users = new UserManagement(); SendBirdUser user = users.manageUser(); - System.out.println(user); + user); assertEquals(user.getNickname(), "updated-nickname"); }