aboutsummaryrefslogtreecommitdiffstats
path: root/config-lib/src/test/java/com/yahoo/config/FileNodeTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-lib/src/test/java/com/yahoo/config/FileNodeTest.java')
-rw-r--r--config-lib/src/test/java/com/yahoo/config/FileNodeTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/config-lib/src/test/java/com/yahoo/config/FileNodeTest.java b/config-lib/src/test/java/com/yahoo/config/FileNodeTest.java
index 56dd7dd116d..1ad9f722eca 100644
--- a/config-lib/src/test/java/com/yahoo/config/FileNodeTest.java
+++ b/config-lib/src/test/java/com/yahoo/config/FileNodeTest.java
@@ -4,6 +4,7 @@ package com.yahoo.config;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
/**
@@ -11,6 +12,7 @@ import static org.junit.Assert.assertTrue;
* @since 5.1
*/
public class FileNodeTest {
+
@Test
public void testSetValue() {
FileNode n = new FileNode();
@@ -20,5 +22,10 @@ public class FileNodeTest {
assertTrue(n.doSetValue("\"foo.txt\""));
assertEquals("foo.txt", n.value().value());
assertEquals("\"foo.txt\"", n.toString());
+
+ assertThrows("path may not start with '..', but got: foo/../../boo",
+ IllegalArgumentException.class,
+ () -> new FileNode("foo/../../boo"));
}
+
}