From d54e418ca916b7a456415eb0efecd227fe09e3af Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 16 Nov 2024 18:46:10 +0100 Subject: [PATCH] remove unused imports, function & did some formatting in tests --- .../java/com/questhelper/steps/WidgetStep.java | 2 -- src/test/java/com/questhelper/MockedTest.java | 17 +---------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/main/java/com/questhelper/steps/WidgetStep.java b/src/main/java/com/questhelper/steps/WidgetStep.java index d78a103893..203bfbc957 100644 --- a/src/main/java/com/questhelper/steps/WidgetStep.java +++ b/src/main/java/com/questhelper/steps/WidgetStep.java @@ -31,8 +31,6 @@ import java.util.Arrays; import java.util.List; import java.util.function.BiConsumer; -import java.util.function.Consumer; -import java.util.function.Function; import lombok.Setter; import net.runelite.api.widgets.Widget; import com.questhelper.QuestHelperPlugin; diff --git a/src/test/java/com/questhelper/MockedTest.java b/src/test/java/com/questhelper/MockedTest.java index 139eded7e3..501da5301c 100644 --- a/src/test/java/com/questhelper/MockedTest.java +++ b/src/test/java/com/questhelper/MockedTest.java @@ -46,12 +46,8 @@ import org.junit.jupiter.api.BeforeEach; import org.mockito.Mockito; import javax.inject.Named; -import java.awt.*; import java.awt.image.BufferedImage; -import java.util.Random; import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ThreadLocalRandom; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; /** @@ -113,17 +109,6 @@ public abstract class MockedTest extends MockedTestBase @Bind @Named("developerMode") private boolean developerMode; - - public BufferedImage random(final int width, final int height) { - Random rand = ThreadLocalRandom.current(); - BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); - for (int x = 0; x < width; x++) { - for (int y = 0; y < height; y++) { - image.setRGB(x, y, new Color(rand.nextFloat(), rand.nextFloat(), rand.nextFloat()).getRGB()); - } - } - return image; - } @Override @@ -134,7 +119,7 @@ protected void setUp() when(questHelperPlugin.getPlayerStateManager()).thenReturn(playerStateManager); when(playerStateManager.getAccountType()).thenReturn(AccountType.NORMAL); - when(client.getIntStack()).thenReturn(new int[] { 1, 1, 1, 1 }); + when(client.getIntStack()).thenReturn(new int[] {1, 1, 1, 1}); when(questHelperConfig.solvePuzzles()).thenReturn(true); when(spriteManager.getSprite(SpriteID.TAB_QUESTS, 0)).thenReturn(new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB));