mirror of
https://github.com/thunderbird/thunderbird-android.git
synced 2024-09-20 04:02:14 +02:00
Don't call open()
from RealImapFolder.appendMessages()
This commit is contained in:
parent
874b06f415
commit
94e0ced621
@ -964,7 +964,6 @@ internal class RealImapFolder(
|
||||
*/
|
||||
@Throws(MessagingException::class)
|
||||
override fun appendMessages(messages: List<Message>): Map<String, String>? {
|
||||
open(OpenMode.READ_WRITE)
|
||||
checkOpen()
|
||||
|
||||
return try {
|
||||
|
@ -994,6 +994,19 @@ class RealImapFolderTest {
|
||||
assertThat(buffer.readUtf8()).isEqualTo("text")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `appendMessages() on closed folder should throw`() {
|
||||
val folder = createFolder("Folder")
|
||||
val messages = listOf(createImapMessage("1"))
|
||||
|
||||
assertFailure {
|
||||
folder.appendMessages(messages)
|
||||
}.isInstanceOf<MessagingException>()
|
||||
.hasMessage("Folder Folder is not open.")
|
||||
|
||||
verifyNoMoreInteractions(imapConnection)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun appendMessages_shouldIssueRespectiveCommand() {
|
||||
val folder = createFolder("Folder")
|
||||
|
Loading…
Reference in New Issue
Block a user