Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion core/android/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ plugins {
}

android {
namespace = "app.k9mail.core.android.testing"
namespace = "net.thunderbird.core.android.testing"
}

dependencies {
api(libs.junit)
api(libs.robolectric)

implementation(projects.legacy.core)
Comment thread
kewisch marked this conversation as resolved.
Outdated

api(libs.koin.core)
api(libs.mockito.core)
api(libs.mockito.kotlin)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fsck.k9.testing
package net.thunderbird.core.android.testing

import org.mockito.Mockito
import org.mockito.Mockito.mock
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app.k9mail.core.android.testing
package net.thunderbird.core.android.testing

import android.app.Application
import org.junit.runner.RunWith
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.fsck.k9.testing
package net.thunderbird.core.android.testing

fun String.removeNewlines(): String = replace("([\\r\\n])".toRegex(), "")
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.fsck.k9.autocrypt

import app.k9mail.core.android.testing.RobolectricTest
import assertk.assertThat
import assertk.assertions.isEqualTo
import assertk.assertions.isFalse
import assertk.assertions.isNotNull
import assertk.assertions.isNull
import assertk.assertions.isTrue
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test

class AutocryptDraftStateHeaderParserTest : RobolectricTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.io.IOException;
import java.io.InputStream;

import app.k9mail.core.android.testing.RobolectricTest;
import net.thunderbird.core.android.testing.RobolectricTest;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.internet.BinaryTempFileBody;
import com.fsck.k9.mail.internet.MimeMessage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.fsck.k9.helper

import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.Identity
import app.k9mail.legacy.account.LegacyAccount
import assertk.assertThat
Expand All @@ -11,6 +10,7 @@ import com.fsck.k9.mail.Message.RecipientType
import com.fsck.k9.mail.internet.AddressHeaderBuilder
import com.fsck.k9.mail.internet.MimeMessage
import java.util.UUID
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test

class IdentityHelperTest : RobolectricTest() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.fsck.k9.helper;

import app.k9mail.core.android.testing.RobolectricTest;
import net.thunderbird.core.android.testing.RobolectricTest;
import com.fsck.k9.mail.Address;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.internet.MimeMessage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.fsck.k9.helper

import androidx.core.net.toUri
import app.k9mail.core.android.testing.RobolectricTest
import assertk.assertThat
import assertk.assertions.isEqualTo
import assertk.assertions.isNull
import com.fsck.k9.mail.internet.MimeMessage
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test

class ListUnsubscribeHelperTest : RobolectricTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.fsck.k9.helper

import android.net.Uri
import androidx.core.net.toUri
import app.k9mail.core.android.testing.RobolectricTest
import assertk.assertFailure
import assertk.assertThat
import assertk.assertions.containsExactly
Expand All @@ -13,6 +12,7 @@ import assertk.assertions.isInstanceOf
import assertk.assertions.isNull
import assertk.assertions.isTrue
import com.fsck.k9.mail.Address
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test

class MailToTest : RobolectricTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.graphics.Color
import android.text.SpannableString
import app.k9mail.core.android.common.contact.Contact
import app.k9mail.core.android.common.contact.ContactRepository
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.core.common.mail.EmailAddress
import app.k9mail.core.common.mail.toEmailAddressOrThrow
import assertk.assertThat
Expand All @@ -14,6 +13,7 @@ import com.fsck.k9.CoreResourceProvider
import com.fsck.k9.TestCoreResourceProvider
import com.fsck.k9.helper.MessageHelper.Companion.toFriendly
import com.fsck.k9.mail.Address
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.lang.reflect.Array;
import java.util.ArrayList;

import app.k9mail.core.android.testing.RobolectricTest;
import net.thunderbird.core.android.testing.RobolectricTest;
import app.k9mail.legacy.account.LegacyAccount;
import com.fsck.k9.helper.ReplyToParser.ReplyToAddresses;
import com.fsck.k9.mail.Address;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import android.net.Uri;

import app.k9mail.core.android.testing.RobolectricTest;
import net.thunderbird.core.android.testing.RobolectricTest;
import com.fsck.k9.mail.BodyPart;
import com.fsck.k9.mail.Multipart;
import com.fsck.k9.mail.Part;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.fsck.k9.message

import android.net.Uri
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.Identity
import app.k9mail.legacy.account.QuoteStyle
import assertk.Assert
Expand All @@ -10,6 +9,7 @@ import assertk.assertions.contains
import assertk.assertions.isGreaterThan
import com.fsck.k9.mail.internet.MimeHeaderChecker
import com.fsck.k9.mail.internet.TextBody
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test

private const val IDENTITY_HEADER = "X-K9mail-Identity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.fsck.k9.message

import app.k9mail.core.android.testing.RobolectricTest
import assertk.assertThat
import assertk.assertions.contains
import com.fsck.k9.helper.toCrLf
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test

class IdentityHeaderParserTest : RobolectricTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.List;
import java.util.Map;

import app.k9mail.core.android.testing.RobolectricTest;
import net.thunderbird.core.android.testing.RobolectricTest;
import app.k9mail.legacy.account.QuoteStyle;
import com.fsck.k9.CoreResourceProvider;
import app.k9mail.legacy.account.Identity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.net.Uri;
import androidx.annotation.Nullable;

import app.k9mail.core.android.testing.RobolectricTest;
import net.thunderbird.core.android.testing.RobolectricTest;
import com.fsck.k9.mail.Part;
import com.fsck.k9.mail.internet.MimeBodyPart;
import com.fsck.k9.mail.internet.MimeHeader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.fsck.k9.message.quote

import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.QuoteStyle
import assertk.assertThat
import assertk.assertions.isEqualTo
Expand All @@ -10,6 +9,7 @@ import com.fsck.k9.mail.Message
import com.fsck.k9.mail.Message.RecipientType
import com.fsck.k9.mail.testing.crlf
import java.util.Date
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import assertk.assertThat
import assertk.assertions.isEqualTo
import com.fsck.k9.message.html.HtmlHelper.extractText
import com.fsck.k9.message.signature.HtmlSignatureRemover.Companion.stripSignature
import com.fsck.k9.testing.removeNewlines
import net.thunderbird.core.android.testing.removeNewlines
import org.junit.Test

class HtmlSignatureRemoverTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import android.app.PendingIntent
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.test.core.app.ApplicationProvider
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.LegacyAccount
import com.fsck.k9.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test
import org.mockito.Mockito.verify
import org.mockito.kotlin.any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import android.app.PendingIntent
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.test.core.app.ApplicationProvider
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.LegacyAccount
import com.fsck.k9.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test
import org.mockito.Mockito.verify
import org.mockito.kotlin.any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package com.fsck.k9.notification

import androidx.core.app.NotificationCompat
import androidx.test.core.app.ApplicationProvider
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.LegacyAccount
import com.fsck.k9.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test
import org.mockito.Mockito.verify
import org.mockito.kotlin.any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.fsck.k9.notification

import app.k9mail.core.android.common.contact.ContactRepository
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.LegacyAccount
import app.k9mail.legacy.message.controller.MessageReference
import app.k9mail.legacy.message.extractors.PreviewResult.PreviewType
Expand All @@ -10,6 +9,7 @@ import assertk.assertions.isEqualTo
import com.fsck.k9.mail.Address
import com.fsck.k9.mail.Message.RecipientType
import com.fsck.k9.mailstore.LocalMessage
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test
import org.mockito.kotlin.any
import org.mockito.kotlin.doReturn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.fsck.k9.notification

import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.LegacyAccount
import app.k9mail.legacy.message.controller.MessageReference
import assertk.assertThat
Expand All @@ -15,6 +14,7 @@ import assertk.assertions.isNull
import assertk.assertions.isSameInstanceAs
import assertk.assertions.isTrue
import kotlin.test.assertNotNull
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test

private const val ACCOUNT_UUID = "1-2-3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import android.app.PendingIntent
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.test.core.app.ApplicationProvider
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.LegacyAccount
import com.fsck.k9.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test
import org.mockito.ArgumentMatchers.anyLong
import org.mockito.Mockito.verify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import android.app.PendingIntent
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.test.core.app.ApplicationProvider
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.LegacyAccount
import com.fsck.k9.mailstore.LocalFolder
import com.fsck.k9.notification.NotificationIds.getFetchingMailNotificationId
import com.fsck.k9.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.MockHelper.mockBuilder
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test
import org.mockito.ArgumentMatchers.anyLong
import org.mockito.Mockito.verify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.fsck.k9.preferences

import app.k9mail.core.android.testing.RobolectricTest
import assertk.all
import assertk.assertThat
import assertk.assertions.containsExactly
Expand All @@ -14,6 +13,7 @@ import com.fsck.k9.preferences.SettingsFile.Account
import com.fsck.k9.preferences.SettingsFile.Identity
import com.fsck.k9.preferences.SettingsFile.Server
import java.util.UUID
import net.thunderbird.core.android.testing.RobolectricTest
import org.junit.Test

class SettingsFileParserTest : RobolectricTest() {
Expand Down
6 changes: 0 additions & 6 deletions legacy/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ plugins {

dependencies {
implementation(projects.legacy.core)

api(projects.core.android.testing)

api(libs.koin.core)
api(libs.mockito.core)
api(libs.mockito.kotlin)
}

android {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.fsck.k9.activity.compose

import android.os.Bundle
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.Identity
import assertk.assertThat
import assertk.assertions.isFalse
import assertk.assertions.isSameInstanceAs
import assertk.assertions.isTrue
import com.fsck.k9.RobolectricTest
import com.fsck.k9.mail.Address
import org.junit.Test
import org.mockito.kotlin.doReturn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.fsck.k9.contacts

import app.k9mail.core.android.testing.RobolectricTest
import assertk.assertThat
import assertk.assertions.isEqualTo
import com.fsck.k9.RobolectricTest
import com.fsck.k9.mail.Address
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package com.fsck.k9.ui.helper

import android.os.Build
import android.os.SystemClock
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.core.testing.TestClock
import assertk.assertThat
import assertk.assertions.isEqualTo
import com.fsck.k9.RobolectricTest
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.ZoneId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.fsck.k9.ui.helper

import app.k9mail.core.android.testing.RobolectricTest
import assertk.assertThat
import assertk.assertions.isEqualTo
import com.fsck.k9.RobolectricTest
import org.junit.Test
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.graphics.Color
import android.text.Spannable
import android.text.style.ForegroundColorSpan
import androidx.core.text.getSpans
import app.k9mail.core.android.testing.RobolectricTest
import app.k9mail.legacy.account.Identity
import app.k9mail.legacy.account.LegacyAccount
import assertk.assertThat
Expand All @@ -13,6 +12,7 @@ import assertk.assertions.isEqualTo
import assertk.assertions.isInstanceOf
import assertk.assertions.isNotNull
import assertk.assertions.isNull
import com.fsck.k9.RobolectricTest
import com.fsck.k9.helper.ContactNameProvider
import com.fsck.k9.mail.Address
import org.junit.Test
Expand Down
Loading