Skip to content

Commit

Permalink
#1881 - Fix flaky test.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Nov 16, 2022
1 parent 92bd627 commit 2e02d7a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class HateoasConfigurationIntegrationTest {
@Test // #1075
void loadsLanguageSpecificResourceBundle() throws Exception {

var original = (String) ReflectionTestUtils.getField(HateoasConfiguration.class, "I18N_BASE_NAME");

ReflectionTestUtils.setField(HateoasConfiguration.class, "I18N_BASE_NAME",
"org/springframework/hateoas/config/rest-messages");

Expand All @@ -45,6 +47,9 @@ void loadsLanguageSpecificResourceBundle() throws Exception {
MessageResolver resolver = context.getBean(MessageResolver.class);

assertThat(resolver.resolve(() -> new String[] { "key" })).isEqualTo("Schlüssel");

} finally {
ReflectionTestUtils.setField(HateoasConfiguration.class, "I18N_BASE_NAME", original);
}
}
}

0 comments on commit 2e02d7a

Please sign in to comment.