Skip to content

Commit

Permalink
fix : SignInRepositoryImplTest last() 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
nohjunh committed May 11, 2024
1 parent a2c322b commit 1bdfe0a
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package online.partyrun.partyrunapplication.core.data.repository

import com.google.gson.Gson
import kotlinx.coroutines.flow.last
import kotlinx.coroutines.test.runTest
import okhttp3.OkHttpClient
import okhttp3.mockwebserver.MockResponse
Expand Down Expand Up @@ -33,7 +32,8 @@ class SignInRepositoryImplTest {
.baseUrl(mockWebServer.url("/"))
.client(
OkHttpClient.Builder()
.build())
.build()
)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(ApiResponseCallAdapterFactory.create())
.build()
Expand All @@ -58,7 +58,7 @@ class SignInRepositoryImplTest {
mockWebServer.enqueue(mockResponse)


val actualResponse = repository.signInWithGoogleTokenViaServer(idToken).last()
val actualResponse = repository.signInWithGoogleTokenViaServer(idToken)
assertEquals(Result.Success(tokenSet), actualResponse)
}

Expand All @@ -71,7 +71,7 @@ class SignInRepositoryImplTest {
.setResponseCode(400)
mockWebServer.enqueue(mockResponse)

val actualResponse = repository.signInWithGoogleTokenViaServer(idToken).last()
val actualResponse = repository.signInWithGoogleTokenViaServer(idToken)
assertTrue(actualResponse is Result.Failure && actualResponse.code == 400)
}

Expand All @@ -84,7 +84,7 @@ class SignInRepositoryImplTest {
.setResponseCode(401)
mockWebServer.enqueue(mockResponse)

val actualResponse = repository.signInWithGoogleTokenViaServer(idToken).last()
val actualResponse = repository.signInWithGoogleTokenViaServer(idToken)
assertTrue(actualResponse is Result.Failure && actualResponse.code == 401)
}

Expand All @@ -97,7 +97,7 @@ class SignInRepositoryImplTest {
.setResponseCode(HttpURLConnection.HTTP_INTERNAL_ERROR)
mockWebServer.enqueue(mockResponse)

val actualResponse = repository.signInWithGoogleTokenViaServer(idToken).last()
val actualResponse = repository.signInWithGoogleTokenViaServer(idToken)
assertTrue(actualResponse is Result.Failure && actualResponse.code == HttpURLConnection.HTTP_INTERNAL_ERROR)
}
}

0 comments on commit 1bdfe0a

Please sign in to comment.