diff --git a/wrappers/serializer/src/test/java/it/angrybear/yagl/particles/ParticleParserTest.java b/wrappers/serializer/src/test/java/it/angrybear/yagl/particles/ParticleParserTest.java index 765ed2ac..f4cd942f 100644 --- a/wrappers/serializer/src/test/java/it/angrybear/yagl/particles/ParticleParserTest.java +++ b/wrappers/serializer/src/test/java/it/angrybear/yagl/particles/ParticleParserTest.java @@ -5,8 +5,10 @@ import it.angrybear.yagl.parsers.WrappersYAGLParser; import it.angrybear.yagl.wrappers.Potion; import it.fulminazzo.fulmicollection.utils.ReflectionUtils; +import it.fulminazzo.yamlparser.configuration.ConfigurationSection; import it.fulminazzo.yamlparser.configuration.FileConfiguration; import it.fulminazzo.yamlparser.utils.FileUtils; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -16,8 +18,7 @@ import java.util.Arrays; import java.util.stream.Stream; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.*; class ParticleParserTest extends ParserTestHelper { @@ -88,6 +89,16 @@ void testTypes(AParticleType type) throws IOException { } } + @Test + void testNullType() { + WrappersYAGLParser.addAllParsers(); + ConfigurationSection particleSection = new ConfigurationSection(null, "main"); + particleSection.set("particle.type", null); + + assertThrowsExactly(IllegalArgumentException.class, () -> + particleSection.get("particle", Particle.class)); + } + @Override protected Class getParser() { return ParticleParser.class;