Skip to content

Commit

Permalink
Test invalid deserializer in node helper
Browse files Browse the repository at this point in the history
  • Loading branch information
virustotalop committed Aug 1, 2020
1 parent d18f9ba commit 81548db
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.clubobsidian.wrappy.test.helper;

import static org.junit.Assert.assertTrue;

import java.io.File;

import org.junit.Test;
import org.spongepowered.configurate.ConfigurationNode;

import com.clubobsidian.wrappy.Configuration;
import com.clubobsidian.wrappy.helper.NodeHelper;

public class NodeHelperTest {

@Test
public void testInvalid() {
Configuration config = Configuration.load(new File("test.yml"));
ConfigurationNode node = config.getNode();
NodeHelper<Double> helper = new NodeHelper<>(node);
assertTrue(helper.get("key", Double.class) == null);
}
}

0 comments on commit 81548db

Please sign in to comment.