Skip to content

Commit

Permalink
Fixed integration tests against 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
anti-social committed Nov 15, 2021
1 parent 85d5427 commit f31051d
Showing 1 changed file with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,23 @@ class SearchQueryTests : ElasticsearchTestBase() {
.execute(index)
}
}
}

@Test
fun internalServerError() = runTestWithTransports {
withFixtures(OrderDoc, listOf(karlssonsBestDonuts)) {
shouldThrow<ElasticsearchException.Internal> {
SearchQuery(::OrderDocSource)
.sort(
Sort(
Script.Source("doc['unknown'].value"),
scriptType = "number"
)
val query = SearchQuery(::OrderDocSource)
.sort(
Sort(
Script.Source("doc['unknown'].value"),
scriptType = "number"
)
.execute(index)
)
if (cluster.getVersion().major < 7) {
shouldThrow<ElasticsearchException.Internal> {
query.execute(index)
}
} else {
shouldThrow<ElasticsearchException.BadRequest> {
query.execute(index)
}
}
}
}
Expand Down

0 comments on commit f31051d

Please sign in to comment.