1.10 API + cleanup
This commit is contained in:
@@ -50,7 +50,6 @@ public class CommandConsistencyTest {
|
||||
*
|
||||
* @return collection of all base command labels
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private static Collection<List<String>> initializeCommands() {
|
||||
CommandInitializer initializer = new CommandInitializer();
|
||||
Collection<List<String>> commandLabels = new ArrayList<>();
|
||||
|
||||
@@ -81,13 +81,13 @@ public class CommandHandlerTest {
|
||||
* <p>
|
||||
* The {@link CommandMapper} is mocked in {@link #initializeCommandMapper()} to return certain test classes.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void setInjectorToMockExecutableCommandClasses() {
|
||||
given(initializer.newInstance(any(Class.class))).willAnswer(new Answer<Object>() {
|
||||
@Override
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||
Class<?> clazz = (Class<?>) invocation.getArguments()[0];
|
||||
if (ExecutableCommand.class.isAssignableFrom(clazz)) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Class<? extends ExecutableCommand> commandClass = (Class<? extends ExecutableCommand>) clazz;
|
||||
ExecutableCommand mock = mock(commandClass);
|
||||
mockedCommands.put(commandClass, mock);
|
||||
|
||||
@@ -33,7 +33,6 @@ public class CommandInitializerTest {
|
||||
|
||||
private static Set<CommandDescription> commands;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@BeforeClass
|
||||
public static void initializeCommandCollection() {
|
||||
CommandInitializer commandInitializer = new CommandInitializer();
|
||||
|
||||
@@ -280,6 +280,7 @@ public class CommandMapperTest {
|
||||
assertThat(result.getArguments(), contains(parts.get(2)));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void shouldReturnExecutableCommandClasses() {
|
||||
// given / when
|
||||
|
||||
@@ -38,6 +38,7 @@ public class PlayerCommandTest {
|
||||
// given
|
||||
Player player = mock(Player.class);
|
||||
List<String> arguments = Arrays.asList("arg1", "testarg2");
|
||||
@SuppressWarnings("unused")
|
||||
CommandService service = mock(CommandService.class);
|
||||
PlayerCommandImpl command = new PlayerCommandImpl();
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ public class ReloadCommandTest {
|
||||
public void shouldHandleReloadError() {
|
||||
// given
|
||||
CommandSender sender = mock(CommandSender.class);
|
||||
@SuppressWarnings("unused")
|
||||
CommandService service = mock(CommandService.class);
|
||||
doThrow(IllegalStateException.class).when(initializer).performReloadOnServices();
|
||||
given(settings.getProperty(DatabaseSettings.BACKEND)).willReturn(DataSourceType.MYSQL);
|
||||
@@ -104,6 +105,7 @@ public class ReloadCommandTest {
|
||||
public void shouldIssueWarningForChangedDatasourceSetting() {
|
||||
// given
|
||||
CommandSender sender = mock(CommandSender.class);
|
||||
@SuppressWarnings("unused")
|
||||
CommandService service = mock(CommandService.class);
|
||||
given(settings.getProperty(DatabaseSettings.BACKEND)).willReturn(DataSourceType.MYSQL);
|
||||
given(dataSource.getType()).willReturn(DataSourceType.SQLITE);
|
||||
|
||||
Reference in New Issue
Block a user