Skip to content

Commit

Permalink
Remove new tests
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
  • Loading branch information
acarbonetto committed Sep 10, 2024
1 parent 12f5980 commit 1995b1a
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions java/client/src/test/java/glide/api/GlideClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1546,52 +1546,52 @@ public void invokeScript_with_ScriptOptions_returns_success() {
assertEquals(payload, response.get());
}

@SneakyThrows
@Test
public void scriptShow_returns_script_source() {
// setup
String scriptSource = "return { KEYS[1], ARGV[1] }";
Script script = mock(Script.class);
String hash = UUID.randomUUID().toString();
when(script.getHash()).thenReturn(hash);

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() {
// setup
GlideString scriptSource = gs("return { KEYS[1], ARGV[1] }");
Script script = mock(Script.class);
GlideString hash = gs(UUID.randomUUID().toString());
when(script.getHash()).thenReturn(hash.toString());

CompletableFuture<GlideString> testResponse = new CompletableFuture<>();
testResponse.complete(scriptSource);

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

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

// verify
assertEquals(testResponse, response);
assertEquals(scriptSource, response.get());
}
// @SneakyThrows
// @Test
// public void scriptShow_returns_script_source() {
// // setup
// String scriptSource = "return { KEYS[1], ARGV[1] }";
// Script script = mock(Script.class);
// String hash = UUID.randomUUID().toString();
// when(script.getHash()).thenReturn(hash);
//
// 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() {
// // setup
// GlideString scriptSource = gs("return { KEYS[1], ARGV[1] }");
// Script script = mock(Script.class);
// GlideString hash = gs(UUID.randomUUID().toString());
// when(script.getHash()).thenReturn(hash.toString());
//
// CompletableFuture<GlideString> testResponse = new CompletableFuture<>();
// testResponse.complete(scriptSource);
//
// when(commandManager.<GlideString>submitNewCommand(
// eq(ScriptShow), eq(new GlideString[] {hash}), any()))
// .thenReturn(testResponse);
//
// // exercise
// CompletableFuture<GlideString> response = service.scriptShow(hash);
//
// // verify
// assertEquals(testResponse, response);
// assertEquals(scriptSource, response.get());
// }

@SneakyThrows
@Test
Expand Down

0 comments on commit 1995b1a

Please sign in to comment.