@@ -0,0 +1,2705 @@
+package com.tisawesomeness.minecord.command.player;%0A%0Aimport com.tisawesomeness.minecord.command.Result;%0Aimport com.tisawesomeness.minecord.config.ConfigReader;%0Aimport com.tisawesomeness.minecord.mc.player.Username;%0Aimport com.tisawesomeness.minecord.testutil.mc.TestMCLibrary;%0Aimport com.tisawesomeness.minecord.testutil.mc.TestPlayerProvider;%0Aimport com.tisawesomeness.minecord.testutil.runner.TestCommandRunner;%0A%0Aimport com.fasterxml.jackson.core.JsonProcessingException;%0Aimport org.junit.jupiter.api.BeforeAll;%0Aimport org.junit.jupiter.api.DisplayName;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport static com.tisawesomeness.minecord.testutil.runner.CommandAssertions.assertThat;%0A%0Apublic class CapeCommandIT %7B%0A%0A    private static final Username THROWING_USERNAME = new Username(%22throw%22);%0A    private static TestCommandRunner runner;%0A%0A    @BeforeAll%0A    private static void initRunner() throws JsonProcessingException %7B%0A        runner = new TestCommandRunner(ConfigReader.readFromResources(), new CapeCommand());%0A        TestMCLibrary library = new TestMCLibrary();%0A        TestPlayerProvider playerProvider = library.getPlayerProvider();%0A        playerProvider.throwOnUsername(THROWING_USERNAME);%0A        runner.mcLibrary = library;%0A    %7D%0A%0A    @Test%0A    @DisplayName(%22Cape command with no args only requests help%22)%0A    public void testNoArgs() %7B%0A        assertThat(runner.run()).onlyShowsHelp();%0A    %7D%0A%0A    @Test%0A    @DisplayName(%22Cape command with too long username warns the user%22)%0A    public void testTooLong() %7B%0A        String args = %22A%22.repeat(Username.MAX_LENGTH + 1);%0A        assertThat(runner.run(args))%0A                .awaitResult()%0A                .hasNotTriggeredCooldown()%0A                .resultIs(Result.WARNING);%0A    %7D%0A%0A    @Test%0A    @DisplayName(%22Cape command with non-ascii username warns the user%22)%0A    public void testNonAsciiUsername() %7B%0A        String args = %22oo%CE%B8oo%22;%0A        assertThat(runner.run(args))%0A                .awaitResult()%0A                .hasNotTriggeredCooldown()%0A                .resultIs(Result.WARNING);%0A    %7D%0A%0A    @Test%0A    @DisplayName(%22Cape command responds with error when an IOE is thrown%22)%0A    public void testIOE() %7B%0A        String args = THROWING_USERNAME.toString();%0A        assertThat(runner.run(args))%0A                .awaitResult()%0A                .resultIs(Result.ERROR)%0A                .embedRepliesIsEmpty();%0A    %7D%0A%0A    @Test%0A    @DisplayName(%22Cape command responds with success, even though the username doesn't exist%22)%0A    public void testNonExistentUsername() %7B%0A        String args = %22DoesNotExist%22;%0A        assertThat(runner.run(args))%0A                .awaitResult()%0A                .hasTriggeredCooldown()%0A                .isSuccess();%0A    %7D%0A%0A%7D%0A

Test &cape