-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: include set value to Set Response (#101)
include set value to Set Response
- Loading branch information
1 parent
4f15ad3
commit 89383db
Showing
6 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
momento-sdk/src/intTest/java/momento/sdk/ScsDataTestHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package momento.sdk; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertArrayEquals; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.io.IOException; | ||
import java.nio.ByteBuffer; | ||
import java.nio.charset.StandardCharsets; | ||
import momento.sdk.messages.CacheSetResponse; | ||
import momento.sdk.messages.MomentoCacheResult; | ||
import org.apache.commons.io.IOUtils; | ||
|
||
final class ScsDataTestHelper { | ||
private ScsDataTestHelper() {} | ||
|
||
static void assertSetResponse(String expectedValue, CacheSetResponse setResponse) | ||
throws IOException { | ||
assertEquals(MomentoCacheResult.Ok, setResponse.result()); | ||
assertEquals(expectedValue, setResponse.string().get()); | ||
assertArrayEquals(expectedValue.getBytes(), setResponse.byteArray().get()); | ||
assertEquals(ByteBuffer.wrap(expectedValue.getBytes()), setResponse.byteBuffer().get()); | ||
assertTrue( | ||
IOUtils.contentEquals( | ||
IOUtils.toInputStream(expectedValue, StandardCharsets.UTF_8), | ||
setResponse.inputStream().get())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters