From f31051d581b565d049a8766f3a611eca3b109232 Mon Sep 17 00:00:00 2001 From: Alexander Koval Date: Mon, 15 Nov 2021 09:54:04 +0200 Subject: [PATCH] Fixed integration tests against 7.x --- .../dev/evo/elasticmagic/SearchQueryTests.kt | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/integ-tests/src/commonTest/kotlin/dev/evo/elasticmagic/SearchQueryTests.kt b/integ-tests/src/commonTest/kotlin/dev/evo/elasticmagic/SearchQueryTests.kt index 5082f861cd..96bdcb5f1a 100644 --- a/integ-tests/src/commonTest/kotlin/dev/evo/elasticmagic/SearchQueryTests.kt +++ b/integ-tests/src/commonTest/kotlin/dev/evo/elasticmagic/SearchQueryTests.kt @@ -218,20 +218,23 @@ class SearchQueryTests : ElasticsearchTestBase() { .execute(index) } } - } - @Test - fun internalServerError() = runTestWithTransports { withFixtures(OrderDoc, listOf(karlssonsBestDonuts)) { - shouldThrow { - 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 { + query.execute(index) + } + } else { + shouldThrow { + query.execute(index) + } } } }