diff --git a/src/test/java/io/supertokens/test/ConfigTest2_21.java b/src/test/java/io/supertokens/test/ConfigTest2_21.java index 73b886f6f..086cbd1bf 100644 --- a/src/test/java/io/supertokens/test/ConfigTest2_21.java +++ b/src/test/java/io/supertokens/test/ConfigTest2_21.java @@ -24,6 +24,7 @@ import org.junit.*; import org.junit.rules.TestRule; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class ConfigTest2_21 { @@ -84,4 +85,23 @@ public void testThatNewConfigWorks() throws Exception { EventAndException stopEvent = process.checkOrWaitForEvent(PROCESS_STATE.STOPPED); assertNotNull(stopEvent); } + + @Test + public void testCoreConfigTypeValidationInConfigYaml() throws Exception { + Utils.setValueInConfig("access_token_validity", "abcd"); + + String[] args = { "../" }; + + TestingProcess process = TestingProcessManager.start(args); + + EventAndException startEvent = process.checkOrWaitForEvent(PROCESS_STATE.INIT_FAILURE); + assertNotNull(startEvent); + + assertEquals("io.supertokens.pluginInterface.exceptions.InvalidConfigException: 'access_token_validity' must be of type long", startEvent.exception.getMessage()); + + process.kill(); + EventAndException stopEvent = process.checkOrWaitForEvent(PROCESS_STATE.STOPPED); + assertNotNull(stopEvent); + + } }