Skip to content

Commit

Permalink
fix: startup test
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Dec 6, 2023
1 parent 748307d commit 0c00922
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/java/io/supertokens/test/ConfigTest2_21.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);

}
}

0 comments on commit 0c00922

Please sign in to comment.