From 111fc30c6d7bfd4db308dd38f568cfc5fc2c6ab4 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Sat, 19 Apr 2025 06:41:30 -0700 Subject: [PATCH] Use explicit newline with keystore stdin test The add string keystore command accepts input on stdin. In this case, the terminal is responsible for separating input by newlines that are system dependent. The mock terminal normally adds the system dependent newline. However, we also have tests that ensure both unix and windows style newlines are tested explicitly. This commit fixes the windows style carriage returns to explicitly contain a newline. closes #127089 --- .../cli/keystore/AddStringKeyStoreCommandTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java b/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java index 1b368a7c38e0e..17d0abe33f69b 100644 --- a/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java +++ b/distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/AddStringKeyStoreCommandTests.java @@ -193,7 +193,7 @@ public void testStdinInputWithCarriageReturn() throws Exception { String password = "keystorepassword"; KeyStoreWrapper.create().save(env.configDir(), password.toCharArray()); terminal.addSecretInput(password); - terminal.addSecretInput("Typedthisandhitenter\r"); + terminal.addSecretInput("Typedthisandhitenter\r\n"); execute("-x", "foo"); assertSecureString("foo", "Typedthisandhitenter", password); }