Skip to content

Commit

Permalink
Remove the reference to factory variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nosix committed Nov 3, 2020
1 parent 199a23f commit 85dcc02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class WebServiceFactory(baseUrl: String) {
return retrofit.create(service.java)
}

suspend fun authenticate(action: suspend () -> Response<Unit>) {
suspend fun authenticate(action: suspend WebServiceFactory.() -> Response<Unit>) {
val authHeader: String? = action().run {
if (isSuccessful) headers().get("Authorization") else null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class CustomerApiTests {

private suspend fun authenticate() {
factory.authenticate {
factory.create<AuthenticationService>()
create<AuthenticationService>()
.login(Credentials("user", "user_password"))
}
}

private suspend fun authenticateAsAdmin() {
factory.authenticate {
factory.create<AuthenticationService>()
create<AuthenticationService>()
.login(Credentials("admin", "admin_password"))
}
}
Expand Down

0 comments on commit 85dcc02

Please sign in to comment.