Skip to content

Commit 1b0a22b

Browse files
committed
Analysis: Suppress unchecked cast test cast warnings
Warning Message: "Unchecked cast: Xyz to Xyz" These type warnings are suppressed, that is, instead of being resolved, since a resolution would require a proper investigation. As such, it might be best to ignore those as out of scope, for now, and so as to not introduce any breaking changes to these tests overall.
1 parent 632adcc commit 1b0a22b

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

WordPress/src/test/java/org/wordpress/android/ui/engagement/utils/GetLikesTestUtils.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ fun getGetLikesState(testConfig: GetLikesTestConfig): GetLikesState {
119119
}
120120
}
121121

122+
@Suppress("UNCHECKED_CAST")
122123
fun List<LikeModel>.isEqualTo(engageItemList: List<EngageItem>): Boolean {
123124
val sameSize = this.size == engageItemList.size
124125
val likersList = engageItemList as? List<Liker>

WordPress/src/test/java/org/wordpress/android/ui/posts/PrepublishingHomeViewModelTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ class PrepublishingHomeViewModelTest : BaseUnitTest() {
4242
@Mock lateinit var getCategoriesUseCase: GetCategoriesUseCase
4343
@Mock lateinit var site: SiteModel
4444

45-
@InternalCoroutinesApi
4645
@Before
46+
@InternalCoroutinesApi
47+
@Suppress("UNCHECKED_CAST")
4748
fun setUp() {
4849
viewModel = PrepublishingHomeViewModel(
4950
getPostTagsUseCase,

WordPress/src/test/java/org/wordpress/android/ui/stories/usecase/LoadStoryFromStoriesPrefsUseCaseTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class LoadStoryFromStoriesPrefsUseCaseTest {
3636
}
3737

3838
@Test
39+
@Suppress("UNCHECKED_CAST")
3940
fun `obtain empty media ids list from empty mediaFiles array`() {
4041
// Given
4142
val mediaFiles: ArrayList<HashMap<String, Any>> = setupMediaFiles(emptyList = true)
@@ -50,6 +51,7 @@ class LoadStoryFromStoriesPrefsUseCaseTest {
5051
}
5152

5253
@Test
54+
@Suppress("UNCHECKED_CAST")
5355
fun `obtain media ids list from non empty mediaFiles array`() {
5456
// Given
5557
val mediaFiles: ArrayList<HashMap<String, Any>> = setupMediaFiles(emptyList = false)

0 commit comments

Comments
 (0)