Skip to content

Commit 6401dfa

Browse files
Spotless
1 parent 394b31c commit 6401dfa

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed

stream-android-core/src/test/java/io/getstream/android/core/internal/http/interceptor/StreamEndpointErrorInterceptorTest.kt

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
/*
22
* Copyright (c) 2014-2025 Stream.io Inc. All rights reserved.
3+
*
4+
* Licensed under the Stream License;
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://github.com/GetStream/stream-core-android/blob/main/LICENSE
9+
*
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.
315
*/
416
package io.getstream.android.core.internal.http.interceptor
517

618
import io.getstream.android.core.api.model.exceptions.StreamEndpointErrorData
719
import io.getstream.android.core.api.model.exceptions.StreamEndpointException
820
import io.getstream.android.core.api.serialization.StreamJsonSerialization
9-
import okhttp3.Connection
1021
import java.io.IOException
1122
import kotlin.test.assertEquals
1223
import kotlin.test.assertFailsWith
24+
import okhttp3.Connection
1325
import okhttp3.Interceptor
1426
import okhttp3.MediaType.Companion.toMediaType
1527
import okhttp3.Protocol
@@ -25,14 +37,24 @@ internal class StreamEndpointErrorInterceptorTest {
2537
private fun chainReturning(response: Response) =
2638
object : Interceptor.Chain {
2739
override fun call() = throw UnsupportedOperationException()
40+
2841
override fun connectTimeoutMillis() = 0
42+
2943
override fun proceed(request: Request): Response = response
44+
3045
override fun connection(): Connection? = null
46+
3147
override fun readTimeoutMillis() = 0
48+
3249
override fun request(): Request = request
33-
override fun withConnectTimeout(timeout: Int, unit: java.util.concurrent.TimeUnit) = this
50+
51+
override fun withConnectTimeout(timeout: Int, unit: java.util.concurrent.TimeUnit) =
52+
this
53+
3454
override fun withReadTimeout(timeout: Int, unit: java.util.concurrent.TimeUnit) = this
55+
3556
override fun withWriteTimeout(timeout: Int, unit: java.util.concurrent.TimeUnit) = this
57+
3658
override fun writeTimeoutMillis() = 0
3759
}
3860

@@ -100,9 +122,12 @@ internal class StreamEndpointErrorInterceptorTest {
100122
}
101123

102124
private class MockJsonSerialization(
103-
private val result: Result<StreamEndpointErrorData> = Result.failure(UnsupportedOperationException()),
125+
private val result: Result<StreamEndpointErrorData> =
126+
Result.failure(UnsupportedOperationException())
104127
) : StreamJsonSerialization {
105-
override fun toJson(any: Any): Result<String> = Result.failure(UnsupportedOperationException())
128+
override fun toJson(any: Any): Result<String> =
129+
Result.failure(UnsupportedOperationException())
130+
106131
override fun <T : Any> fromJson(raw: String, clazz: Class<T>): Result<T> {
107132
@Suppress("UNCHECKED_CAST")
108133
return result as Result<T>

stream-android-core/src/test/java/io/getstream/android/core/internal/model/StreamInternalModelSerializationTest.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
/*
22
* Copyright (c) 2014-2025 Stream.io Inc. All rights reserved.
3+
*
4+
* Licensed under the Stream License;
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://github.com/GetStream/stream-core-android/blob/main/LICENSE
9+
*
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.
315
*/
416
package io.getstream.android.core.internal.model
517

0 commit comments

Comments
 (0)