Skip to content

Commit

Permalink
m7l1 - InMemory repo: Fix Ktor Test serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
phaeton03 committed Sep 19, 2024
1 parent 4b83fc8 commit bcd30fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ abstract class V2AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdCreateResponse
val responseObj = response.body<AdCreateResponse>()
assertEquals(200, response.status.value)
assertEquals(uuidNew, responseObj.ad?.id)
assertEquals(ad.title, responseObj.ad?.title)
Expand All @@ -78,7 +78,7 @@ abstract class V2AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdReadResponse
val responseObj = response.body<AdReadResponse>()
assertEquals(200, response.status.value)
assertEquals(uuidOld, responseObj.ad?.id)
}
Expand All @@ -95,7 +95,7 @@ abstract class V2AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdUpdateResponse
val responseObj = response.body<AdUpdateResponse>()
assertEquals(200, response.status.value)
assertEquals(ad.id, responseObj.ad?.id)
assertEquals(ad.title, responseObj.ad?.title)
Expand All @@ -115,7 +115,7 @@ abstract class V2AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdDeleteResponse
val responseObj = response.body<AdDeleteResponse>()
assertEquals(200, response.status.value)
assertEquals(uuidOld, responseObj.ad?.id)
}
Expand All @@ -130,7 +130,7 @@ abstract class V2AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdSearchResponse
val responseObj = response.body<AdSearchResponse>()
assertEquals(200, response.status.value)
assertNotEquals(0, responseObj.ads?.size)
assertEquals(uuidOld, responseObj.ads?.first()?.id)
Expand All @@ -145,7 +145,7 @@ abstract class V2AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdOffersResponse
val responseObj = response.body<AdOffersResponse>()
assertEquals(200, response.status.value)
assertNotEquals(0, responseObj.ads?.size)
assertEquals(uuidSup, responseObj.ads?.first()?.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ abstract class V1AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdCreateResponse
val responseObj = response.body<AdCreateResponse>()
assertEquals(200, response.status.value)
assertEquals(uuidNew, responseObj.ad?.id)
assertEquals(ad.title, responseObj.ad?.title)
Expand Down Expand Up @@ -94,7 +94,7 @@ abstract class V1AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdUpdateResponse
val responseObj = response.body<AdUpdateResponse>()
assertEquals(200, response.status.value)
assertEquals(ad.id, responseObj.ad?.id)
assertEquals(ad.title, responseObj.ad?.title)
Expand All @@ -114,7 +114,7 @@ abstract class V1AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdDeleteResponse
val responseObj = response.body<AdDeleteResponse>()
assertEquals(200, response.status.value)
assertEquals(uuidOld, responseObj.ad?.id)
}
Expand All @@ -128,7 +128,7 @@ abstract class V1AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdSearchResponse
val responseObj = response.body<AdSearchResponse>()
assertEquals(200, response.status.value)
assertNotEquals(0, responseObj.ads?.size)
assertEquals(uuidOld, responseObj.ads?.first()?.id)
Expand All @@ -143,7 +143,7 @@ abstract class V1AdRepoBaseTest {
debug = AdDebug(mode = workMode),
),
) { response ->
val responseObj = response.body<IResponse>() as AdOffersResponse
val responseObj = response.body<AdOffersResponse>()
assertEquals(200, response.status.value)
assertNotEquals(0, responseObj.ads?.size)
assertEquals(uuidSup, responseObj.ads?.first()?.id)
Expand Down

0 comments on commit bcd30fb

Please sign in to comment.