-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James Robertson
authored and
James Robertson
committed
Oct 31, 2022
1 parent
91ec311
commit 6d24a2d
Showing
15 changed files
with
202 additions
and
83 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 34 additions & 4 deletions
38
samples/announcements/src/test/java/AnnouncementsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,47 @@ | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.openapitools.client.model.SendBirdUser; | ||
import org.junit.jupiter.api.AfterAll; | ||
import org.openapitools.client.model.*; | ||
import org.sendbird.client.ApiClient; | ||
import org.sendbird.client.Configuration; | ||
|
||
import java.math.BigDecimal; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class AnnouncementsTest { | ||
|
||
|
||
@Test | ||
@DisplayName("send announcement") | ||
void testSendAnnouncement() { | ||
Announcements announcements = new Announcements(); | ||
announcements.sendAnnouncement(); | ||
|
||
} | ||
|
||
|
||
@AfterAll | ||
public static void tearDown() { | ||
System.out.println("AbstractBaseTest.tearDown"); | ||
ApiClient defaultClient = Configuration.getDefaultApiClient(); | ||
defaultClient.setBasePath("https://api-"+Config.appId+".sendbird.com"); | ||
User user = new User(defaultClient); | ||
GroupChannel groupChannel = new GroupChannel(defaultClient); | ||
|
||
ListUsersResponse users = user.listUsers("SB::test-user::Java::e2e::"); | ||
for (int i = 0; i < users.getUsers().size(); i++) { | ||
String userIdToDelete = users.getUsers().get(i).getUserId(); | ||
user.deleteUserById(userIdToDelete); | ||
} | ||
|
||
GcListChannelsResponse groupChannelResponse = groupChannel.listChannels("SB::test-gc::Java::e2e::"); | ||
System.out.println(groupChannelResponse); | ||
|
||
for (int i = 0; i < groupChannelResponse.getChannels().size(); i++) { | ||
String channelUrlToDelete = groupChannelResponse.getChannels().get(i).getChannelUrl(); | ||
groupChannel.deleteChannelByUrl(channelUrlToDelete); | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ public class Config { | |
public static String appId = ""; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.