Skip to content

Commit

Permalink
Cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prasanthu committed Nov 26, 2019
1 parent 130f5ff commit f75414e
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions acceptance-tests/src/main/kotlin/org/ostelco/at/jersey/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import kotlin.test.assertFails
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue
import kotlin.test.fail


class CustomerTest {
Expand Down Expand Up @@ -292,23 +293,16 @@ class RegionsTest {
customerId = createCustomer(name = "Test Single Region User", email = email).id
enableRegion(email = email)

val dataMap = MultivaluedHashMap<String, String>()
dataMap["regionCode"] = listOf("no")
dataMap["profileType"] = listOf("iPhone")

var regionDetailsList: Collection<RegionDetails> = get {
path = "/regions"
this.email = email
}

assertEquals(2, regionDetailsList.size, "Customer should have 2 regions")
var receivedRegion = regionDetailsList.find {
it.status == APPROVED
}!!
assertEquals(APPROVED, receivedRegion.status, "Region status do not match")
var receivedRegion = regionDetailsList.find { it.status == APPROVED }
?: fail("Failed to find an approved region.")
val regionCode = receivedRegion.region.id

val simProfile = post<SimProfile> {
val simProfile = post<SimProfile> {
path = "/support/simprofile/$customerId"
this.email = email
this.queryParams = mapOf("regionCode" to regionCode, "profileType" to "iphone", "alias" to "")
Expand All @@ -319,9 +313,8 @@ class RegionsTest {
this.email = email
}
// Find the same Region
receivedRegion = regionDetailsList.find {
it.region.id == regionCode
}!!
receivedRegion = regionDetailsList.find { it.region.id == regionCode }
?: fail("Failed to find the region used to create sim profile.")

assertEquals(
1,
Expand Down

0 comments on commit f75414e

Please sign in to comment.