Skip to content

Commit 67dea1c

Browse files
committed
Fix spotless issues
1 parent fbaa8ea commit 67dea1c

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

core/data/src/main/java/com/google/samples/apps/nowinandroid/core/data/repository/fake/FakeAuthorsRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
2424
import com.google.samples.apps.nowinandroid.core.network.fake.FakeAssetManager
2525
import com.google.samples.apps.nowinandroid.core.network.fake.FakeDataSource
2626
import com.google.samples.apps.nowinandroid.core.network.model.NetworkAuthor
27+
import java.io.InputStream
28+
import javax.inject.Inject
2729
import kotlinx.coroutines.CoroutineDispatcher
2830
import kotlinx.coroutines.flow.Flow
2931
import kotlinx.coroutines.flow.flow
3032
import kotlinx.coroutines.flow.flowOn
3133
import kotlinx.coroutines.flow.map
3234
import kotlinx.serialization.json.Json
3335
import kotlinx.serialization.json.decodeFromStream
34-
import java.io.InputStream
35-
import javax.inject.Inject
3636

3737
/**
3838
* Fake implementation of the [AuthorsRepository] that returns hardcoded authors.

core/data/src/main/java/com/google/samples/apps/nowinandroid/core/data/repository/fake/FakeNewsRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
2727
import com.google.samples.apps.nowinandroid.core.network.fake.FakeAssetManager
2828
import com.google.samples.apps.nowinandroid.core.network.fake.FakeDataSource
2929
import com.google.samples.apps.nowinandroid.core.network.model.NetworkNewsResource
30+
import java.io.InputStream
31+
import javax.inject.Inject
3032
import kotlinx.coroutines.CoroutineDispatcher
3133
import kotlinx.coroutines.flow.Flow
3234
import kotlinx.coroutines.flow.flow
3335
import kotlinx.coroutines.flow.flowOn
3436
import kotlinx.serialization.json.Json
3537
import kotlinx.serialization.json.decodeFromStream
36-
import java.io.InputStream
37-
import javax.inject.Inject
3838

3939
/**
4040
* Fake implementation of the [NewsRepository] that retrieves the news resources from a JSON String.

core/data/src/main/java/com/google/samples/apps/nowinandroid/core/data/repository/fake/FakeTopicsRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
2424
import com.google.samples.apps.nowinandroid.core.network.fake.FakeAssetManager
2525
import com.google.samples.apps.nowinandroid.core.network.fake.FakeDataSource
2626
import com.google.samples.apps.nowinandroid.core.network.model.NetworkTopic
27+
import java.io.InputStream
28+
import javax.inject.Inject
2729
import kotlinx.coroutines.CoroutineDispatcher
2830
import kotlinx.coroutines.flow.Flow
2931
import kotlinx.coroutines.flow.flow
3032
import kotlinx.coroutines.flow.flowOn
3133
import kotlinx.coroutines.flow.map
3234
import kotlinx.serialization.json.Json
3335
import kotlinx.serialization.json.decodeFromStream
34-
import java.io.InputStream
35-
import javax.inject.Inject
3636

3737
/**
3838
* Fake implementation of the [TopicsRepository] that retrieves the topics from a JSON String, and

core/network/src/main/java/JvmUnitTestFakeAssetManager.kt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/*
22
* Copyright 2022 The Android Open Source Project
33
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
1515
*/
1616

1717
import androidx.annotation.VisibleForTesting
@@ -34,10 +34,10 @@ internal object JvmUnitTestFakeAssetManager : FakeAssetManager {
3434
Missing Android resources properties file.
3535
Did you forget to enable the feature in the gradle build file?
3636
android.testOptions.unitTests.isIncludeAndroidResources = true
37-
""".trimIndent()
37+
""".trimIndent()
3838
}
3939
private val properties = Properties().apply { config.openStream().use(::load) }
4040
private val assets = File(properties["android_merged_assets"].toString())
4141

4242
override fun open(fileName: String): InputStream = File(assets, fileName).inputStream()
43-
}
43+
}

core/network/src/test/java/com/google/samples/apps/nowinandroid/core/network/fake/FakeNiaNetworkDataSourceTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class FakeNiaNetworkDataSourceTest {
4848
@Test
4949
fun testDeserializationOfTopics() = runTest(testDispatcher) {
5050
assertEquals(
51+
/* ktlint-disable max-line-length */
5152
NetworkTopic(
5253
id = "1",
5354
name = "Headlines",
@@ -56,13 +57,15 @@ class FakeNiaNetworkDataSourceTest {
5657
url = "",
5758
imageUrl = "https://firebasestorage.googleapis.com/v0/b/now-in-android.appspot.com/o/img%2Fic_topic_Headlines.svg?alt=media&token=506faab0-617a-4668-9e63-4a2fb996603f"
5859
),
60+
/* ktlint-enable max-line-length */
5961
subject.getTopics().first()
6062
)
6163
}
6264

6365
@Test
6466
fun testDeserializationOfNewsResources() = runTest(testDispatcher) {
6567
assertEquals(
68+
/* ktlint-disable max-line-length */
6669
NetworkNewsResource(
6770
id = "125",
6871
title = "Android Basics with Compose",
@@ -82,6 +85,7 @@ class FakeNiaNetworkDataSourceTest {
8285
type = Codelab,
8386
topics = listOf("2", "3", "10"),
8487
),
88+
/* ktlint-enable max-line-length */
8589
subject.getNewsResources().find { it.id == "125" }
8690
)
8791
}

0 commit comments

Comments
 (0)