Skip to content

Commit

Permalink
Added response assertion
Browse files Browse the repository at this point in the history
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
  • Loading branch information
ArnyminerZ committed Sep 4, 2023
1 parent e0a218c commit f5ad728
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.arnyminerz.escalaralcoiaicomtat.backend.database.table.BlockingTable
import com.arnyminerz.escalaralcoiaicomtat.backend.server.DataProvider
import com.arnyminerz.escalaralcoiaicomtat.backend.server.base.ApplicationTestBase
import com.arnyminerz.escalaralcoiaicomtat.backend.server.error.Errors
import com.arnyminerz.escalaralcoiaicomtat.backend.utils.getJSONObjectOrNull
import com.arnyminerz.escalaralcoiaicomtat.backend.utils.jsonOf
import io.ktor.client.request.setBody
import java.time.LocalDateTime
Expand All @@ -35,7 +36,9 @@ class TestAddBlockEndpoint: ApplicationTestBase() {
).toString()
)
}.apply {
assertSuccess()
assertSuccess {
assertNotNull(it?.getJSONObjectOrNull("element"))
}
}

ServerDatabase.instance.query {
Expand Down Expand Up @@ -115,7 +118,9 @@ class TestAddBlockEndpoint: ApplicationTestBase() {
).toString()
)
}.apply {
assertSuccess()
assertSuccess {
assertNotNull(it?.getJSONObjectOrNull("element"))
}
}

ServerDatabase.instance.query {
Expand Down Expand Up @@ -146,7 +151,9 @@ class TestAddBlockEndpoint: ApplicationTestBase() {
).toString()
)
}.apply {
assertSuccess()
assertSuccess {
assertNotNull(it?.getJSONObjectOrNull("element"))
}
}

ServerDatabase.instance.query {
Expand Down

0 comments on commit f5ad728

Please sign in to comment.