Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java: Add script show unit test for basic strings #2283

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions java/client/src/test/java/glide/api/GlideClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> testResponse = new CompletableFuture<>();
testResponse.complete(scriptSource);

when(commandManager.<String>submitNewCommand(eq(ScriptShow), eq(new String[] {hash}), any()))
.thenReturn(testResponse);

// exercise
CompletableFuture<String> response = service.scriptShow(hash);

// verify
assertEquals(testResponse, response);
assertEquals(scriptSource, response.get());
}

@SneakyThrows
@Test
public void scriptShow_returns_script_source_glidestring() {
Expand Down
Loading