otj-pg-embedded: overriding locale settings not working

Hi,

I am using this lib in a project which is operated across different geographies. The locale settings picked up by the lib is OS default. Few of my team members sit in Poland and they have set the OS locale to “Polish” language. We have our tests written where we assert the error messages coming from postgres. The assertions are written in english like:

assertThat(ex.errorMessage(), containsString("Unique constraint violation"));

this assertion fails on their machine because the error message in polish language. I have tried overriding the default OS locale settings from this lib like:

            EmbeddedPostgres.builder()
                    .setLocaleConfig("LANGUAGE", "en_US.UTF-8")
                    .setLocaleConfig("LC_ALL", "en_US.UTF-8")
                    .start();

but it fails to start without giving any explicit exception. Can you please confirm if i am using it in correct way?

Thanks Vikesh

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

I ended up guilt tripping myself and building, should be released shortly

That sounds reasonable. Maybe Steven wil have an idea. In meantime why not use the sql error code for some of this? It’s language independent and hence a better thing to code against.