Skip to content

Commit

Permalink
rename fileSize to fileSizeInBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
AfanasievAnton committed May 22, 2024
1 parent 39d89d9 commit d15ec5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import com.genesys.cloud.messenger.transport.utility.MessageValues
import com.genesys.cloud.messenger.transport.utility.QuickReplyTestValues
import com.genesys.cloud.messenger.transport.utility.StructuredMessageValues
import com.genesys.cloud.messenger.transport.utility.TestValues
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString
import net.bytebuddy.utility.RandomString
import org.junit.Test
Expand Down Expand Up @@ -172,13 +171,13 @@ internal class MessageExtensionTest {
"first test attachment id" to Attachment(
id = "first test attachment id",
fileName = "test.png",
fileSize = AttachmentValues.FileSize,
fileSizeInBytes = AttachmentValues.FileSize,
Attachment.State.Uploaded("http://test.com")
),
"second test attachment id" to Attachment(
id = "second test attachment id",
fileName = "test2.png",
fileSize = null,
fileSizeInBytes = null,
Attachment.State.Detached,
)
)
Expand All @@ -188,7 +187,7 @@ internal class MessageExtensionTest {
attachment = Attachment(
id = "first test attachment id",
fileName = "test.png",
fileSize = AttachmentValues.FileSize,
fileSizeInBytes = AttachmentValues.FileSize,
state = Attachment.State.Uploaded("http://test.com")
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlinx.serialization.Transient
data class Attachment(
val id: String,
@Transient val fileName: String? = null,
@Transient val fileSize: Int? = null,
@Transient val fileSizeInBytes: Int? = null,
@Transient val state: State = State.Presigning,
) {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private fun List<AttachmentContent>.toAttachments(): Map<String, Attachment> {
attachment.id to Attachment(
id = attachment.id,
fileName = attachment.filename,
fileSize = attachment.fileSize,
fileSizeInBytes = attachment.fileSize,
state = Attachment.State.Sent(attachment.url),
)
}
Expand Down

0 comments on commit d15ec5e

Please sign in to comment.