From 25ef3dfcd09a7293ccf2d65626304e30599029d2 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 30 May 2019 22:19:14 -0700 Subject: [PATCH] Check message instead of toString for DS_Store test The plugin service special cases .DS_Store on MacOS, to not think it is a plugin. The tests for this behavior also check an appropriate error occurs on non macos systems. On Linux, the test checks the exception message, but uses toString(), which uses a localized version of the exception message. This commit changes the test to instead check the exception message directly, so as not to depend on the locale. closes #41689 --- .../java/org/elasticsearch/plugins/PluginsServiceTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java b/server/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java index b9459b926d372..b853b94195519 100644 --- a/server/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java +++ b/server/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java @@ -171,7 +171,7 @@ public void testDesktopServicesStoreFiles() throws IOException { if (Constants.WINDOWS) { assertThat(e.getCause(), instanceOf(NoSuchFileException.class)); } else { - assertThat(e.getCause(), hasToString(containsString("Not a directory"))); + assertThat(e.getCause().getMessage(), containsString("Not a directory")); } } }