Skip to content

Commit

Permalink
Fixed PostgresContainerTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
mx-smblt committed Jan 20, 2025
1 parent 1c24967 commit e05a7b8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class PostgresContainerTest(dockerImageName: String = "postgres:15.4") {
.executeQuery()
.let { result ->
var hasResult = result.next()
if (!hasResult) failure(NO_ROWS_FOUND)
if (!hasResult) throw failure(NO_ROWS_FOUND)
var index = 0
while (hasResult) {
assertions(result, index++)
Expand Down Expand Up @@ -89,7 +89,7 @@ public class PostgresContainerTest(dockerImageName: String = "postgres:15.4") {
.executeQuery()
.let { result ->
var hasResult = result.next()
if (!hasResult) failure(NO_ROWS_FOUND)
if (!hasResult) throw failure(NO_ROWS_FOUND)
var index = 0
while (hasResult) {
assertion(result, index++)
Expand All @@ -108,15 +108,15 @@ public class PostgresContainerTest(dockerImageName: String = "postgres:15.4") {
.executeQuery()
.let { result ->
var hasResult = result.next()
if (!hasResult) failure(NO_ROWS_FOUND)
if (!hasResult) throw failure(NO_ROWS_FOUND)
var index = 0
while (hasResult) {
if (currentAssertionIndex != assertionCount) {
val assertion = assertions[currentAssertionIndex]
assertion(result, index++)
currentAssertionIndex++
} else
failure("There are fewer assertions than rows.")
throw failure("There are fewer assertions than rows.")

hasResult = result.next()
}
Expand Down

0 comments on commit e05a7b8

Please sign in to comment.