Compare commits
3 Commits
e43a8a7239
...
35a2a6c518
Author | SHA1 | Date |
---|---|---|
dankito | 35a2a6c518 | |
dankito | 3273b2a849 | |
dankito | 75450e77fb |
|
@ -7,6 +7,10 @@ kotlin {
|
|||
jvmToolchain(11)
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
|
||||
val kotlinCoroutinesVersion: String by project
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class MailReader(
|
|||
|
||||
fun listAllMessagesWithEInvoice(account: MailAccount, downloadMessageBody: Boolean = false, emailFolderName: String = "INBOX"): List<MailWithInvoice> {
|
||||
try {
|
||||
connect(account) { store ->
|
||||
return connect(account) { store ->
|
||||
val inbox = store.getFolder(emailFolderName)
|
||||
inbox.open(Folder.READ_ONLY)
|
||||
|
||||
|
@ -243,7 +243,7 @@ class MailReader(
|
|||
date.toInstant()
|
||||
|
||||
|
||||
private fun <T> connect(account: MailAccount, connected: (Store) -> T?): T? {
|
||||
private fun <T> connect(account: MailAccount, connected: (Store) -> T): T {
|
||||
val properties = mapAccountToJavaMailProperties(account)
|
||||
|
||||
val session = Session.getInstance(properties)
|
||||
|
|
|
@ -25,7 +25,7 @@ class MailReaderTest {
|
|||
|
||||
@Test
|
||||
fun listAllMessagesWithEInvoice() {
|
||||
val result = underTest.listAllMessagesWithEInvoice(mailAccount)
|
||||
val result = underTest.listAllMessagesWithEInvoice(mailAccount, true)
|
||||
|
||||
assertThat(result).isNotEmpty()
|
||||
|
||||
|
|
Loading…
Reference in New Issue