Configuration for not resolving correctly

In one project, we have an application in our tests where the values for are resolving to the default values (H2 profile) as configured by testkit, even though we have the following in our application.conf:

db.default.driver = "org.postgresql.Driver"
jdbc-defaults.slick.profile = "slick.jdbc.PostgresProfile$"

When I check the application configuration on startup, it is reading that correctly from application.conf, however, when I inspect and they contain the default settings from the testkit reference.conf (and so it tries to use H2 and fails). The lagom-persistence-jdbc-core has a reference.conf that should be resolving those values from the application.conf:

  # Slick configuration
  slick {

    # The Slick profile
    profile = ${?jdbc-defaults.slick.profile}

    # The Slick driver - for backward compatibility only, will be removed in 1.5.0 (@deprecated)
    driver = ${?jdbc-defaults.slick.driver}

    jndiDbName = ${jdbc-defaults.slick.jndiDbName}

What would cause the configuration to resolve out of order?

For now I’m just hard-coding those values in our application.conf and that resolves the issue: = "org.postgresql.Driver" = "slick.jdbc.PostgresProfile$"

PS this is where it’s getting the H2 defaults from lagom/reference.conf at master · lagom/lagom · GitHub

This seems to only happen in IntelliJ and not on the command line, so probably it has something to do with ordering of classpath.