Skip to content

Commit

Permalink
Sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
jpraet committed Nov 5, 2024
1 parent a683b8d commit 075d8f5
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void getLocalizedMessageFromDefaultBelgifResourceBundleNl() {

@Test
void getLocalizedMessageFromDefaultBelgifResourceBundleUnsupportedLanguage() {
TestLocaleResolver.setLocale(new Locale("es"));
TestLocaleResolver.setLocale(Locale.forLanguageTag("es"));
assertThat(I18N.getLocalizedString("BadGatewayProblem.detail"))
.isEqualTo("Error in communication with upstream service");
}
Expand Down Expand Up @@ -84,16 +84,16 @@ void getLocalizedMessageFromCustomResourceBundle() {
@Test
@SetSystemProperty(key = I18N.I18N_FLAG, value = "false")
void disabledViaSystemProperty() {
I18N.init();
assertThat(I18N.isEnabled()).isFalse();
TestLocaleResolver.setLocale(Locale.forLanguageTag("nl-BE"));
assertThat(I18N.getLocalizedString("BadGatewayProblem.detail"))
.isEqualTo("Error in communication with upstream service");
assertDisabled();
}

@Test
@SetEnvironmentVariable(key = I18N.I18N_FLAG, value = "false")
void disabledViaEnvironmentVariable() {
assertDisabled();
}

private void assertDisabled() {
I18N.init();
assertThat(I18N.isEnabled()).isFalse();
TestLocaleResolver.setLocale(Locale.forLanguageTag("nl-BE"));
Expand Down

0 comments on commit 075d8f5

Please sign in to comment.