From d49f5161b020696fb13ea65052ead6bcc1d366df Mon Sep 17 00:00:00 2001 From: Intybyte Date: Sat, 31 Aug 2024 09:06:00 +0200 Subject: [PATCH] Update test --- .../core/services/sounds/TestSoundService.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/sounds/TestSoundService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/sounds/TestSoundService.java index 73a69a6d71..44569d23ba 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/sounds/TestSoundService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/sounds/TestSoundService.java @@ -3,6 +3,8 @@ import be.seeseemelk.mockbukkit.MockBukkit; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import org.junit.jupiter.api.*; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; public class TestSoundService { @@ -19,16 +21,12 @@ public static void unload() { MockBukkit.unmock(); } - @Test @DisplayName("Testing each SoundConfiguration") - void testSounds() { + @ParameterizedTest + @EnumSource(SoundEffect.class) + void testSounds(SoundEffect effect) { SoundService service = Slimefun.getSoundService(); - SoundEffect[] effects = SoundEffect.values(); - - for (SoundEffect i : effects) { - SoundConfiguration element = service.getConfiguration(i); - Assertions.assertNotNull(element, "The sound effect must not be null!"); - } - + SoundConfiguration element = service.getConfiguration(effect); + Assertions.assertNotNull(element, "The sound effect must not be null!"); } }