Skip to content

Commit

Permalink
use bmw in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tonisives committed Mar 10, 2023
1 parent d2a6e00 commit bae13fa
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ internal class UtilityRequestsTest : BaseTest() {
val webService = UtilityRequests(client, mockLogger, mockUrl, authTokenRequests)

val response = runBlocking {
webService.getEligibility("WBADT43452G296403", Brand.MERCEDES_BENZ)
webService.getEligibility("WBADT43452G296403", Brand.BMW)
}

coVerify { authTokenRequests.getAuthToken() }
Expand All @@ -97,7 +97,7 @@ internal class UtilityRequestsTest : BaseTest() {
assertTrue(recordedRequest.headers["Authorization"] == "Bearer ${authToken.authToken}")
val jsonBody = Json.parseToJsonElement(recordedRequest.body.readUtf8())
assertTrue(jsonBody.jsonObject["vin"]?.jsonPrimitive?.contentOrNull == "WBADT43452G296403")
assertTrue(jsonBody.jsonObject["brand"]?.jsonPrimitive?.contentOrNull == "mercedes-benz")
assertTrue(jsonBody.jsonObject["brand"]?.jsonPrimitive?.contentOrNull == "bmw")

// verify response
val status = response.response!!
Expand Down Expand Up @@ -134,7 +134,7 @@ internal class UtilityRequestsTest : BaseTest() {
val webService = UtilityRequests(client, mockLogger, mockUrl, authTokenRequests)

val status = runBlocking {
webService.getEligibility("WBADT43452G296403", Brand.MERCEDES_BENZ)
webService.getEligibility("WBADT43452G296403", Brand.BMW)
}.response!!

coVerify { authTokenRequests.getAuthToken() }
Expand All @@ -146,7 +146,7 @@ internal class UtilityRequestsTest : BaseTest() {
assertTrue(recordedRequest.headers["Authorization"] == "Bearer ${authToken.authToken}")
val jsonBody = Json.parseToJsonElement(recordedRequest.body.readUtf8())
assertTrue(jsonBody.jsonObject["vin"]?.jsonPrimitive?.contentOrNull == "WBADT43452G296403")
assertTrue(jsonBody.jsonObject["brand"]?.jsonPrimitive?.contentOrNull == "mercedes-benz")
assertTrue(jsonBody.jsonObject["brand"]?.jsonPrimitive?.contentOrNull == "bmw")

// verify response
assertTrue(status.vin == "WBADT43452G296403")
Expand All @@ -165,7 +165,7 @@ internal class UtilityRequestsTest : BaseTest() {
val webService = UtilityRequests(client, mockLogger, mockUrl, authTokenRequests)
webService.getEligibility(
"WBADT43452G296403",
Brand.MERCEDES_BENZ,
Brand.BMW,
)
}
}
Expand All @@ -176,7 +176,7 @@ internal class UtilityRequestsTest : BaseTest() {
val webService = UtilityRequests(client, mockLogger, mockUrl, authTokenRequests)
webService.getEligibility(
"WBADT43452G296403",
Brand.MERCEDES_BENZ,
Brand.BMW,
)
}
}
Expand All @@ -187,7 +187,7 @@ internal class UtilityRequestsTest : BaseTest() {
val webService = UtilityRequests(client, mockLogger, mockUrl, authTokenRequests)
webService.getEligibility(
"WBADT43452G296403",
Brand.MERCEDES_BENZ,
Brand.BMW,
)
}
}
Expand Down

0 comments on commit bae13fa

Please sign in to comment.