mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-08 18:07:39 +00:00
[AB-53] adding economy related commands
adding runtime exception to root command handling adding simple custom command module disabling slash command for show emote the utility is not given (the bot cannot show any emotes from servers its not in) fixing post target setup not allowing threads fixing post targets not supporting threads fixing interactions not considering the actual amount of embeds fixing some cases for events which are not in a guild
This commit is contained in:
@@ -89,10 +89,10 @@ public class CommandManagerTest {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
}
|
||||
|
||||
@Test(expected = CommandNotFoundException.class)
|
||||
@Test
|
||||
public void testFindByParametersNoCommands(){
|
||||
when(commandInServerAliasService.getCommandInServerAlias(SERVER_ID, COMMAND_NAME)).thenReturn(Optional.empty());
|
||||
testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertFalse(testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID).isPresent());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -102,8 +102,8 @@ public class CommandManagerTest {
|
||||
when(firstCommand.getConfiguration()).thenReturn(commandConfiguration);
|
||||
when(commandConfiguration.getNecessaryParameterCount()).thenReturn(0);
|
||||
when(parsedCommandParameter.getParameters()).thenReturn(new ArrayList<>());
|
||||
Command foundCommand = testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand);
|
||||
Optional<Command> foundCommand = testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -112,8 +112,8 @@ public class CommandManagerTest {
|
||||
when(commandConfiguration.getName()).thenReturn(COMMAND_NAME);
|
||||
when(firstCommand.getConfiguration()).thenReturn(commandConfiguration);
|
||||
when(commandConfiguration.getParameters()).thenReturn(null);
|
||||
Command foundCommand = testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand);
|
||||
Optional<Command> foundCommand = testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -122,8 +122,8 @@ public class CommandManagerTest {
|
||||
when(commandConfiguration.getName()).thenReturn(COMMAND_NAME);
|
||||
when(firstCommand.getConfiguration()).thenReturn(commandConfiguration);
|
||||
when(commandConfiguration.getParameters()).thenReturn(null);
|
||||
Command foundCommand = testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand);
|
||||
Optional<Command> foundCommand = testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -134,8 +134,8 @@ public class CommandManagerTest {
|
||||
when(firstCommand.getConfiguration()).thenReturn(commandConfiguration);
|
||||
when(commandConfiguration.getNecessaryParameterCount()).thenReturn(0);
|
||||
when(parsedCommandParameter.getParameters()).thenReturn(new ArrayList<>());
|
||||
Command foundCommand = testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand);
|
||||
Optional<Command> foundCommand = testUnit.findCommandByParameters(COMMAND_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand.get());
|
||||
}
|
||||
|
||||
@Test(expected = InsufficientParametersException.class)
|
||||
@@ -157,8 +157,8 @@ public class CommandManagerTest {
|
||||
when(commandConfiguration.getNecessaryParameterCount()).thenReturn(0);
|
||||
when(parsedCommandParameter.getParameters()).thenReturn(new ArrayList<>());
|
||||
setupAliasTest();
|
||||
Command foundCommand = testUnit.findCommandByParameters(ALIAS_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand);
|
||||
Optional<Command> foundCommand = testUnit.findCommandByParameters(ALIAS_NAME, parsedCommandParameter, SERVER_ID);
|
||||
Assert.assertEquals(firstCommand, foundCommand.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user