avaje / avaje-config

Application configuration / properties loading for JVM applications
https://avaje.io/config
Apache License 2.0
55 stars 8 forks source link

Repeated calls to Config.get() with no value, expect to return passed default value #18

Closed rbygrave closed 3 years ago

rbygrave commented 3 years ago

When there is no value for myapp.doesNotExist3 then expect:

  @Test
  public void get_default_repeated_expect_returnDefaultValue() {
    assertThat(Config.get("myapp.doesNotExist3", null)).isNull();
    assertThat(Config.get("myapp.doesNotExist3", "other")).isEqualTo("other");
    assertThat(Config.get("myapp.doesNotExist3", "foo")).isEqualTo("foo");
    assertThat(Config.get("myapp.doesNotExist3", "junk")).isEqualTo("junk");
  }