diff --git a/java/client/src/test/java/glide/api/GlideClientTest.java b/java/client/src/test/java/glide/api/GlideClientTest.java index e1e6a530a2..f9aa61daeb 100644 --- a/java/client/src/test/java/glide/api/GlideClientTest.java +++ b/java/client/src/test/java/glide/api/GlideClientTest.java @@ -1582,6 +1582,27 @@ public void invokeScript_with_ScriptOptionsGlideString_returns_success() { assertEquals(payload, response.get()); } + @SneakyThrows + @Test + public void scriptShow_returns_script_source() { + // setup + String scriptSource = "return { KEYS[1], ARGV[1] }"; + String hash = UUID.randomUUID().toString(); + + CompletableFuture testResponse = new CompletableFuture<>(); + testResponse.complete(scriptSource); + + when(commandManager.submitNewCommand(eq(ScriptShow), eq(new String[] {hash}), any())) + .thenReturn(testResponse); + + // exercise + CompletableFuture response = service.scriptShow(hash); + + // verify + assertEquals(testResponse, response); + assertEquals(scriptSource, response.get()); + } + @SneakyThrows @Test public void scriptShow_returns_script_source_glidestring() {