Skip to content

Commit

Permalink
Add media channel to message forwarding test
Browse files Browse the repository at this point in the history
  • Loading branch information
Vankka committed Jan 26, 2025
1 parent ac13679 commit d54fe75
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class FullBootExtension implements BeforeAllCallback, ExtensionContext.St
public static String BOT_TOKEN = System.getenv("DISCORDSRV_AUTOTEST_BOT_TOKEN");
public static String TEXT_CHANNEL_ID = System.getenv("DISCORDSRV_AUTOTEST_CHANNEL_ID");
public static String FORUM_CHANNEL_ID = System.getenv("DISCORDSRV_AUTOTEST_FORUM_ID");
public static String MEDIA_CHANNEL_ID = System.getenv("DISCORDSRV_AUTOTEST_MEDIA_ID");
public static String VOICE_CHANNEL_ID = System.getenv("DISCORDSRV_AUTOTEST_VOICE_ID");

public static boolean started = false;
Expand All @@ -38,6 +39,7 @@ public void beforeAll(ExtensionContext context) {
Assumptions.assumeTrue(BOT_TOKEN != null, "Automated testing bot token");
Assumptions.assumeTrue(TEXT_CHANNEL_ID != null, "Automated testing text channel id");
Assumptions.assumeTrue(FORUM_CHANNEL_ID != null, "Automated testing forum channel id");
Assumptions.assumeTrue(MEDIA_CHANNEL_ID != null, "Automated testing media channel id");
Assumptions.assumeTrue(VOICE_CHANNEL_ID != null, "Automated testing voice channel id");

if (started) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ public MainConfig config() {

if (StringUtils.isNotEmpty(FullBootExtension.TEXT_CHANNEL_ID)
&& StringUtils.isNotEmpty(FullBootExtension.FORUM_CHANNEL_ID)
&& StringUtils.isNotEmpty(FullBootExtension.MEDIA_CHANNEL_ID)
&& StringUtils.isNotEmpty(FullBootExtension.VOICE_CHANNEL_ID)
) {
ChannelConfig global = (ChannelConfig) config.channels.get(GameChannel.DEFAULT_NAME);
Expand All @@ -277,6 +278,7 @@ public MainConfig config() {
long textChannelId = Long.parseLong(FullBootExtension.TEXT_CHANNEL_ID);
long voiceChannelId = Long.parseLong(FullBootExtension.VOICE_CHANNEL_ID);
long forumId = Long.parseLong(FullBootExtension.FORUM_CHANNEL_ID);
long mediaId = Long.parseLong(FullBootExtension.FORUM_CHANNEL_ID);

List<Long> channelIds = destination.channelIds;
channelIds.clear();
Expand All @@ -293,6 +295,10 @@ public MainConfig config() {
ThreadConfig forumThread = new ThreadConfig();
forumThread.channelId = forumId;
threadConfigs.add(forumThread);

ThreadConfig mediaThread = new ThreadConfig();
mediaThread.channelId = mediaId;
threadConfigs.add(mediaThread);
}

return config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void onForwarded(GameChatMessageForwardedEvent event) {
}
}

success.complete(text == 1 && voice == 1 && thread == 2);
success.complete(text == 1 && voice == 1 && thread == 3);
}
}
}

0 comments on commit d54fe75

Please sign in to comment.