Skip to content

Commit

Permalink
fix: test defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Dec 6, 2023
1 parent 17add08 commit f21a726
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/java/io/supertokens/test/ConfigMapperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ public static class DummyConfig {

@Test
public void testAllValidConversions() throws Exception {
// Test defaults
{
JsonObject config = new JsonObject();
assertEquals(-1, ConfigMapper.mapConfig(config, DummyConfig.class).int_property);
assertEquals(-1, ConfigMapper.mapConfig(config, DummyConfig.class).long_property);
assertEquals(-1, ConfigMapper.mapConfig(config, DummyConfig.class).float_property, 0.0001);
assertEquals(-1, ConfigMapper.mapConfig(config, DummyConfig.class).double_property, 0.0001);
assertEquals("default_string", ConfigMapper.mapConfig(config, DummyConfig.class).string_property);
assertEquals(new Long(-1), ConfigMapper.mapConfig(config, DummyConfig.class).nullable_long_property);
}

// valid for int
{
JsonObject config = new JsonObject();
Expand Down

0 comments on commit f21a726

Please sign in to comment.