diff --git a/app/core/build.gradle.kts b/app/core/build.gradle.kts index b33a85c02..7ba0b6816 100644 --- a/app/core/build.gradle.kts +++ b/app/core/build.gradle.kts @@ -28,6 +28,7 @@ dependencies { implementation(libs.mime4j.dom) testApi(projects.core.testing) + testApi(projects.core.android.testing) testImplementation(projects.mail.testing) testImplementation(projects.backend.imap) testImplementation(projects.mail.protocols.smtp) diff --git a/app/core/src/test/java/com/fsck/k9/autocrypt/AutocryptDraftStateHeaderParserTest.kt b/app/core/src/test/java/com/fsck/k9/autocrypt/AutocryptDraftStateHeaderParserTest.kt index c9b12cb37..4d30ff754 100644 --- a/app/core/src/test/java/com/fsck/k9/autocrypt/AutocryptDraftStateHeaderParserTest.kt +++ b/app/core/src/test/java/com/fsck/k9/autocrypt/AutocryptDraftStateHeaderParserTest.kt @@ -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 com.fsck.k9.RobolectricTest import org.junit.Test class AutocryptDraftStateHeaderParserTest : RobolectricTest() { diff --git a/app/core/src/test/java/com/fsck/k9/autocrypt/AutocryptHeaderParserTest.java b/app/core/src/test/java/com/fsck/k9/autocrypt/AutocryptHeaderParserTest.java index 56f45561b..38d0b95a5 100644 --- a/app/core/src/test/java/com/fsck/k9/autocrypt/AutocryptHeaderParserTest.java +++ b/app/core/src/test/java/com/fsck/k9/autocrypt/AutocryptHeaderParserTest.java @@ -5,7 +5,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import com.fsck.k9.RobolectricTest; +import app.k9mail.core.android.testing.RobolectricTest; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.internet.BinaryTempFileBody; import com.fsck.k9.mail.internet.MimeMessage; diff --git a/app/core/src/test/java/com/fsck/k9/helper/IdentityHelperTest.kt b/app/core/src/test/java/com/fsck/k9/helper/IdentityHelperTest.kt index f6a3e0feb..aade6b77c 100644 --- a/app/core/src/test/java/com/fsck/k9/helper/IdentityHelperTest.kt +++ b/app/core/src/test/java/com/fsck/k9/helper/IdentityHelperTest.kt @@ -1,10 +1,10 @@ package com.fsck.k9.helper +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.isEqualTo import com.fsck.k9.Account import com.fsck.k9.Identity -import com.fsck.k9.RobolectricTest import com.fsck.k9.mail.Address import com.fsck.k9.mail.Message import com.fsck.k9.mail.Message.RecipientType diff --git a/app/core/src/test/java/com/fsck/k9/helper/ListHeadersTest.java b/app/core/src/test/java/com/fsck/k9/helper/ListHeadersTest.java index 1f0fdfcd6..f2ca0b835 100644 --- a/app/core/src/test/java/com/fsck/k9/helper/ListHeadersTest.java +++ b/app/core/src/test/java/com/fsck/k9/helper/ListHeadersTest.java @@ -1,7 +1,6 @@ package com.fsck.k9.helper; - -import com.fsck.k9.RobolectricTest; +import app.k9mail.core.android.testing.RobolectricTest; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Message; import com.fsck.k9.mail.internet.MimeMessage; @@ -10,7 +9,6 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; - public class ListHeadersTest extends RobolectricTest { private static final String[] TEST_EMAIL_ADDRESSES = new String[] { "prettyandsimple@example.com", diff --git a/app/core/src/test/java/com/fsck/k9/helper/ListUnsubscribeHelperTest.kt b/app/core/src/test/java/com/fsck/k9/helper/ListUnsubscribeHelperTest.kt index 3af5acc44..bfef14f10 100644 --- a/app/core/src/test/java/com/fsck/k9/helper/ListUnsubscribeHelperTest.kt +++ b/app/core/src/test/java/com/fsck/k9/helper/ListUnsubscribeHelperTest.kt @@ -1,10 +1,10 @@ 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.RobolectricTest import com.fsck.k9.mail.internet.MimeMessage import org.junit.Test diff --git a/app/core/src/test/java/com/fsck/k9/helper/MailToTest.java b/app/core/src/test/java/com/fsck/k9/helper/MailToTest.java index d388d4136..e5eebc6b2 100644 --- a/app/core/src/test/java/com/fsck/k9/helper/MailToTest.java +++ b/app/core/src/test/java/com/fsck/k9/helper/MailToTest.java @@ -7,7 +7,7 @@ import java.util.List; import android.net.Uri; -import com.fsck.k9.RobolectricTest; +import app.k9mail.core.android.testing.RobolectricTest; import com.fsck.k9.helper.MailTo.CaseInsensitiveParamWrapper; import com.fsck.k9.mail.Address; import org.junit.Rule; diff --git a/app/core/src/test/java/com/fsck/k9/helper/MessageHelperTest.kt b/app/core/src/test/java/com/fsck/k9/helper/MessageHelperTest.kt index b34ab5d71..fc7d3a982 100644 --- a/app/core/src/test/java/com/fsck/k9/helper/MessageHelperTest.kt +++ b/app/core/src/test/java/com/fsck/k9/helper/MessageHelperTest.kt @@ -4,12 +4,12 @@ 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 import assertk.assertions.isEqualTo import assertk.assertions.isInstanceOf -import com.fsck.k9.RobolectricTest import com.fsck.k9.helper.MessageHelper.Companion.toFriendly import com.fsck.k9.mail.Address import org.junit.Test diff --git a/app/core/src/test/java/com/fsck/k9/helper/ReplyToParserTest.java b/app/core/src/test/java/com/fsck/k9/helper/ReplyToParserTest.java index 6093ed15f..507bb35e0 100644 --- a/app/core/src/test/java/com/fsck/k9/helper/ReplyToParserTest.java +++ b/app/core/src/test/java/com/fsck/k9/helper/ReplyToParserTest.java @@ -1,11 +1,10 @@ package com.fsck.k9.helper; - import java.lang.reflect.Array; import java.util.ArrayList; +import app.k9mail.core.android.testing.RobolectricTest; import com.fsck.k9.Account; -import com.fsck.k9.RobolectricTest; import com.fsck.k9.helper.ReplyToParser.ReplyToAddresses; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Message; diff --git a/app/core/src/test/java/com/fsck/k9/mailstore/AttachmentResolverTest.java b/app/core/src/test/java/com/fsck/k9/mailstore/AttachmentResolverTest.java index 3f5aa79f5..6f17b3235 100644 --- a/app/core/src/test/java/com/fsck/k9/mailstore/AttachmentResolverTest.java +++ b/app/core/src/test/java/com/fsck/k9/mailstore/AttachmentResolverTest.java @@ -5,7 +5,7 @@ import java.util.Map; import android.net.Uri; -import com.fsck.k9.RobolectricTest; +import app.k9mail.core.android.testing.RobolectricTest; import com.fsck.k9.mail.BodyPart; import com.fsck.k9.mail.Multipart; import com.fsck.k9.mail.Part; diff --git a/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt b/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt index 1b4ce118a..9334d26e0 100644 --- a/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt +++ b/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt @@ -1,10 +1,10 @@ package com.fsck.k9.message +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.isGreaterThan import com.fsck.k9.Account.QuoteStyle import com.fsck.k9.Identity -import com.fsck.k9.RobolectricTest import com.fsck.k9.mail.internet.MimeHeaderChecker import com.fsck.k9.mail.internet.TextBody import org.junit.Test diff --git a/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderParserTest.kt b/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderParserTest.kt index f9dd3b8c5..df7aa8d01 100644 --- a/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderParserTest.kt +++ b/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderParserTest.kt @@ -1,8 +1,8 @@ package com.fsck.k9.message +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.contains -import com.fsck.k9.RobolectricTest import com.fsck.k9.helper.toCrLf import org.junit.Test diff --git a/app/core/src/test/java/com/fsck/k9/message/MessageBuilderTest.java b/app/core/src/test/java/com/fsck/k9/message/MessageBuilderTest.java index 267e448b8..0aec39fe8 100644 --- a/app/core/src/test/java/com/fsck/k9/message/MessageBuilderTest.java +++ b/app/core/src/test/java/com/fsck/k9/message/MessageBuilderTest.java @@ -1,6 +1,5 @@ package com.fsck.k9.message; - import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -13,10 +12,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import app.k9mail.core.android.testing.RobolectricTest; import com.fsck.k9.Account.QuoteStyle; import com.fsck.k9.CoreResourceProvider; import com.fsck.k9.Identity; -import com.fsck.k9.RobolectricTest; import com.fsck.k9.TestCoreResourceProvider; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.BodyPart; diff --git a/app/core/src/test/java/com/fsck/k9/message/extractors/AttachmentInfoExtractorTest.java b/app/core/src/test/java/com/fsck/k9/message/extractors/AttachmentInfoExtractorTest.java index c83476a9b..e076676ca 100644 --- a/app/core/src/test/java/com/fsck/k9/message/extractors/AttachmentInfoExtractorTest.java +++ b/app/core/src/test/java/com/fsck/k9/message/extractors/AttachmentInfoExtractorTest.java @@ -1,11 +1,10 @@ package com.fsck.k9.message.extractors; - import android.content.Context; import android.net.Uri; import androidx.annotation.Nullable; -import com.fsck.k9.RobolectricTest; +import app.k9mail.core.android.testing.RobolectricTest; import com.fsck.k9.mail.Part; import com.fsck.k9.mail.internet.MimeBodyPart; import com.fsck.k9.mail.internet.MimeHeader; diff --git a/app/core/src/test/java/com/fsck/k9/message/quote/TextQuoteCreatorTest.kt b/app/core/src/test/java/com/fsck/k9/message/quote/TextQuoteCreatorTest.kt index aa5f4287c..b36b0972d 100644 --- a/app/core/src/test/java/com/fsck/k9/message/quote/TextQuoteCreatorTest.kt +++ b/app/core/src/test/java/com/fsck/k9/message/quote/TextQuoteCreatorTest.kt @@ -1,9 +1,9 @@ package com.fsck.k9.message.quote +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.isEqualTo import com.fsck.k9.Account.QuoteStyle -import com.fsck.k9.RobolectricTest import com.fsck.k9.TestCoreResourceProvider import com.fsck.k9.mail.Address import com.fsck.k9.mail.Message diff --git a/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationControllerTest.kt b/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationControllerTest.kt index c0665d0bd..7b0be0b87 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationControllerTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationControllerTest.kt @@ -5,8 +5,8 @@ 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 com.fsck.k9.Account -import com.fsck.k9.RobolectricTest import com.fsck.k9.testing.MockHelper.mockBuilder import org.junit.Test import org.mockito.Mockito.verify diff --git a/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationControllerTest.kt b/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationControllerTest.kt index 7d74127f6..674e8aed5 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationControllerTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationControllerTest.kt @@ -5,8 +5,8 @@ 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 com.fsck.k9.Account -import com.fsck.k9.RobolectricTest import com.fsck.k9.testing.MockHelper.mockBuilder import org.junit.Test import org.mockito.Mockito.verify diff --git a/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationCreatorTest.kt b/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationCreatorTest.kt index 1d999dfe9..83ae93ccb 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationCreatorTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationCreatorTest.kt @@ -2,8 +2,8 @@ package com.fsck.k9.notification import androidx.core.app.NotificationCompat import androidx.test.core.app.ApplicationProvider +import app.k9mail.core.android.testing.RobolectricTest import com.fsck.k9.Account -import com.fsck.k9.RobolectricTest import com.fsck.k9.testing.MockHelper.mockBuilder import org.junit.Test import org.mockito.Mockito.verify diff --git a/app/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt b/app/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt index e5670c880..190b4b2bc 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt @@ -1,10 +1,10 @@ package com.fsck.k9.notification import app.k9mail.core.android.common.contact.ContactRepository +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.isEqualTo import com.fsck.k9.Account -import com.fsck.k9.RobolectricTest import com.fsck.k9.controller.MessageReference import com.fsck.k9.mail.Address import com.fsck.k9.mail.Message.RecipientType diff --git a/app/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt b/app/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt index ec3103620..192c14581 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt @@ -1,5 +1,6 @@ package com.fsck.k9.notification +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.containsExactly import assertk.assertions.hasSize @@ -12,7 +13,6 @@ import assertk.assertions.isNull import assertk.assertions.isSameAs import assertk.assertions.isTrue import com.fsck.k9.Account -import com.fsck.k9.RobolectricTest import com.fsck.k9.controller.MessageReference import kotlin.test.assertNotNull import org.junit.Test diff --git a/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationControllerTest.kt b/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationControllerTest.kt index 7c41e81fb..202efa3a4 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationControllerTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationControllerTest.kt @@ -5,8 +5,8 @@ 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 com.fsck.k9.Account -import com.fsck.k9.RobolectricTest import com.fsck.k9.testing.MockHelper.mockBuilder import org.junit.Test import org.mockito.ArgumentMatchers.anyLong diff --git a/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt b/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt index 156207dae..edbdd87c6 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt @@ -5,8 +5,8 @@ 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 com.fsck.k9.Account -import com.fsck.k9.RobolectricTest import com.fsck.k9.mailstore.LocalFolder import com.fsck.k9.notification.NotificationIds.getFetchingMailNotificationId import com.fsck.k9.testing.MockHelper.mockBuilder diff --git a/app/testing/build.gradle.kts b/app/testing/build.gradle.kts index 036c1e009..3271ad754 100644 --- a/app/testing/build.gradle.kts +++ b/app/testing/build.gradle.kts @@ -5,8 +5,8 @@ plugins { dependencies { implementation(projects.app.core) - api(libs.junit) - api(libs.robolectric) + api(projects.core.android.testing) + api(libs.koin.core) api(libs.mockito.core) api(libs.mockito.kotlin) diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt index 69c420263..df06ad241 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt @@ -1,12 +1,12 @@ package com.fsck.k9.activity.compose import android.os.Bundle +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.isFalse import assertk.assertions.isSameAs import assertk.assertions.isTrue import com.fsck.k9.Identity -import com.fsck.k9.RobolectricTest import com.fsck.k9.mail.Address import org.junit.Test import org.mockito.kotlin.doReturn diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/contacts/ContactLetterExtractorTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/contacts/ContactLetterExtractorTest.kt index 6c302aa44..1aa20baa8 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/contacts/ContactLetterExtractorTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/contacts/ContactLetterExtractorTest.kt @@ -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 diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/ui/K9DrawerTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/ui/K9DrawerTest.kt index f110a577c..fa5a3fb2f 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/ui/K9DrawerTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/ui/K9DrawerTest.kt @@ -1,9 +1,9 @@ package com.fsck.k9.ui +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.isEqualTo import assertk.assertions.size -import com.fsck.k9.RobolectricTest import com.fsck.k9.core.R import org.junit.Test import org.robolectric.RuntimeEnvironment diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/ui/helper/RelativeDateTimeFormatterTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/ui/helper/RelativeDateTimeFormatterTest.kt index c4e3f24a1..d7cf72f7d 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/ui/helper/RelativeDateTimeFormatterTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/ui/helper/RelativeDateTimeFormatterTest.kt @@ -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 diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/ui/helper/SizeFormatterTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/ui/helper/SizeFormatterTest.kt index 319b2a071..df4ff3538 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/ui/helper/SizeFormatterTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/ui/helper/SizeFormatterTest.kt @@ -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 diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatterTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatterTest.kt index b90a318d3..c7dc7e05d 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatterTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/ui/messagedetails/MessageDetailsParticipantFormatterTest.kt @@ -4,6 +4,7 @@ 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 assertk.assertThat import assertk.assertions.containsExactly import assertk.assertions.isEqualTo @@ -12,7 +13,6 @@ import assertk.assertions.isNotNull import assertk.assertions.isNull import com.fsck.k9.Account import com.fsck.k9.Identity -import com.fsck.k9.RobolectricTest import com.fsck.k9.helper.ContactNameProvider import com.fsck.k9.mail.Address import org.junit.Test diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/ui/messagelist/MessageListAdapterTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/ui/messagelist/MessageListAdapterTest.kt index 4c0be31a9..dc0d18032 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/ui/messagelist/MessageListAdapterTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/ui/messagelist/MessageListAdapterTest.kt @@ -11,6 +11,7 @@ import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.core.view.isGone import androidx.core.view.isVisible +import app.k9mail.core.android.testing.RobolectricTest import app.k9mail.core.testing.TestClock import assertk.Assert import assertk.assertThat @@ -21,7 +22,6 @@ import com.fsck.k9.Account import com.fsck.k9.FontSizes import com.fsck.k9.FontSizes.FONT_DEFAULT import com.fsck.k9.FontSizes.LARGE -import com.fsck.k9.RobolectricTest import com.fsck.k9.UiDensity import com.fsck.k9.contacts.ContactPictureLoader import com.fsck.k9.mail.Address diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatterTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatterTest.kt index 77e324218..7693d8e8c 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatterTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/MessageViewRecipientFormatterTest.kt @@ -4,13 +4,13 @@ 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 assertk.assertThat import assertk.assertions.containsExactly import assertk.assertions.isEqualTo import assertk.assertions.isInstanceOf import com.fsck.k9.Account import com.fsck.k9.Identity -import com.fsck.k9.RobolectricTest import com.fsck.k9.helper.ContactNameProvider import com.fsck.k9.mail.Address import org.junit.Test diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/RecipientLayoutCreatorTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/RecipientLayoutCreatorTest.kt index d277050ea..b9d1a3c31 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/RecipientLayoutCreatorTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/ui/messageview/RecipientLayoutCreatorTest.kt @@ -1,9 +1,9 @@ package com.fsck.k9.ui.messageview +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.isEqualTo import assertk.assertions.isNull -import com.fsck.k9.RobolectricTest import org.junit.Test class RecipientLayoutCreatorTest : RobolectricTest() { diff --git a/core/android/testing/build.gradle.kts b/core/android/testing/build.gradle.kts new file mode 100644 index 000000000..27f82be01 --- /dev/null +++ b/core/android/testing/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id(ThunderbirdPlugins.Library.android) +} + +android { + namespace = "app.k9mail.core.android.testing" +} + +dependencies { + api(libs.junit) + api(libs.robolectric) +} diff --git a/app/testing/src/main/java/com/fsck/k9/RobolectricTest.kt b/core/android/testing/src/main/kotlin/app/k9mail/core/android/testing/RobolectricTest.kt similarity index 82% rename from app/testing/src/main/java/com/fsck/k9/RobolectricTest.kt rename to core/android/testing/src/main/kotlin/app/k9mail/core/android/testing/RobolectricTest.kt index 8dde7f563..79fec5f07 100644 --- a/app/testing/src/main/java/com/fsck/k9/RobolectricTest.kt +++ b/core/android/testing/src/main/kotlin/app/k9mail/core/android/testing/RobolectricTest.kt @@ -1,4 +1,4 @@ -package com.fsck.k9 +package app.k9mail.core.android.testing import android.app.Application import org.junit.runner.RunWith @@ -6,9 +6,7 @@ import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config /** - * A Robolectric test that does not create an instance of our [Application] class [K9]. - * - * See also [K9RobolectricTest]. + * A Robolectric test that does not create an instance of our [Application]. */ @RunWith(RobolectricTestRunner::class) @Config(application = EmptyApplication::class) diff --git a/feature/autodiscovery/providersxml/build.gradle.kts b/feature/autodiscovery/providersxml/build.gradle.kts index b83f1e14c..c4e18a878 100644 --- a/feature/autodiscovery/providersxml/build.gradle.kts +++ b/feature/autodiscovery/providersxml/build.gradle.kts @@ -9,7 +9,7 @@ dependencies { implementation(libs.timber) - testImplementation(projects.app.testing) + testImplementation(projects.core.android.testing) testImplementation(projects.backend.imap) testImplementation(libs.robolectric) testImplementation(libs.androidx.test.core) diff --git a/feature/autodiscovery/providersxml/src/test/kotlin/app/k9mail/autodiscovery/providersxml/ProvidersXmlDiscoveryTest.kt b/feature/autodiscovery/providersxml/src/test/kotlin/app/k9mail/autodiscovery/providersxml/ProvidersXmlDiscoveryTest.kt index 8957f5bed..0758db0b5 100644 --- a/feature/autodiscovery/providersxml/src/test/kotlin/app/k9mail/autodiscovery/providersxml/ProvidersXmlDiscoveryTest.kt +++ b/feature/autodiscovery/providersxml/src/test/kotlin/app/k9mail/autodiscovery/providersxml/ProvidersXmlDiscoveryTest.kt @@ -1,11 +1,11 @@ package app.k9mail.autodiscovery.providersxml import androidx.test.core.app.ApplicationProvider +import app.k9mail.core.android.testing.RobolectricTest import assertk.assertThat import assertk.assertions.isEqualTo import assertk.assertions.isNotNull import assertk.assertions.isNull -import com.fsck.k9.RobolectricTest import com.fsck.k9.mail.AuthType import com.fsck.k9.mail.ConnectionSecurity import com.fsck.k9.oauth.OAuthConfiguration diff --git a/settings.gradle.kts b/settings.gradle.kts index 626dac32d..2a69a8090 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -52,6 +52,7 @@ include( ":core:common", ":core:testing", ":core:android:common", + ":core:android:testing", ":core:ui:compose:common", ":core:ui:compose:designsystem", ":core:ui:compose:theme",