Skip to content
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@ class FilesIntegrationTest : BaseIntegrationTest() {
}

@Test
fun uploadListDownloadDeleteWithCipherUseFileWithLegacyCryptoModule(){
fun uploadListDownloadDeleteWithCipherUseFileWithLegacyCryptoModule() {
Copy link
Contributor

@jguz-pubnub jguz-pubnub Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this test case cover? Have you considered other names for it?

uploadListDownloadDeleteWithCipherUseFileWithLegacyCryptoModule is quite long, and the same applies to uploadListDownloadDeleteWithCipherUseFileWithAesCbcCryptoModule below

EDIT: I see it uploads an encrypted File, then downloads a File from the remote server and compares their contents. If so, what do you think of the following, or something similar?

aesCbcEncryptedFileTransfer
legacyEncryptedFileTransfer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests: upload, then list, then delete file using aesCbc/legacy cryptoModule.
I like proposed names. I will use them.

uploadListDownloadDeleteWithCipherFile(true)
}

@Test
fun uploadListDownloadDeleteWithCipherUseFileWithAesCbcCryptoModule(){
fun uploadListDownloadDeleteWithCipherUseFileWithAesCbcCryptoModule() {
uploadListDownloadDeleteWithCipherFile(false)
}


fun uploadListDownloadDeleteWithCipherFile(withLegacyCrypto: Boolean) {
if(withLegacyCrypto){
if (withLegacyCrypto) {
clientConfig = {
cryptoModule = CryptoModule.createLegacyCryptoModule("enigma")
}
Expand Down Expand Up @@ -123,7 +122,11 @@ class FilesIntegrationTest : BaseIntegrationTest() {
byteStream?.use {
val downloadedContent = it.readBytes()
val downloadedString = String(downloadedContent, StandardCharsets.UTF_8)
Assert.assertEquals("Downloaded content should match original logback.xml", originalContentString, downloadedString)
Assert.assertEquals(
"Downloaded content should match original logback.xml",
originalContentString,
downloadedString
)
}

pubnub.deleteFile(
Expand Down Expand Up @@ -375,11 +378,11 @@ class FilesIntegrationTest : BaseIntegrationTest() {
val channel: String = randomChannel()

val testSizes = listOf(
100, // Small file
1024, // 1KB
10240, // 10KB
102400, // 100KB
524288 // 512KB
100, // Small file
1024, // 1KB
10240, // 10KB
102400, // 100KB
524288 // 512KB
)

for (size in testSizes) {
Expand Down