|
27 | 27 | import com.arangodb.model.*;
|
28 | 28 | import com.arangodb.model.LogOptions.SortOrder;
|
29 | 29 | import com.arangodb.util.RawJson;
|
30 |
| -import com.arangodb.util.TestUtils; |
31 | 30 | import com.arangodb.util.UnicodeUtils;
|
32 | 31 | import com.fasterxml.jackson.databind.JsonNode;
|
| 32 | +import com.fasterxml.jackson.databind.node.JsonNodeFactory; |
33 | 33 | import org.junit.jupiter.api.AfterAll;
|
34 | 34 | import org.junit.jupiter.api.BeforeAll;
|
35 | 35 | import org.junit.jupiter.api.Disabled;
|
36 |
| -import org.junit.jupiter.api.Test; |
37 | 36 | import org.junit.jupiter.params.ParameterizedTest;
|
38 | 37 | import org.junit.jupiter.params.provider.EnumSource;
|
39 | 38 | import org.junit.jupiter.params.provider.MethodSource;
|
@@ -399,6 +398,20 @@ void executeGetVersion(ArangoDB arangoDB) {
|
399 | 398 | }
|
400 | 399 | }
|
401 | 400 |
|
| 401 | + @ParameterizedTest(name = "{index}") |
| 402 | + @MethodSource("arangos") |
| 403 | + void executeJS(ArangoDB arangoDB) { |
| 404 | + assumeTrue(isAtLeastVersion(3, 11)); |
| 405 | + Request<?> request = Request.builder() |
| 406 | + .db(ArangoRequestParam.SYSTEM) |
| 407 | + .method(Request.Method.POST) |
| 408 | + .path("/_admin/execute") |
| 409 | + .body(JsonNodeFactory.instance.textNode("return 11;")) |
| 410 | + .build(); |
| 411 | + final Response<Integer> response = arangoDB.execute(request, Integer.class); |
| 412 | + assertThat(response.getBody()).isEqualTo(11); |
| 413 | + } |
| 414 | + |
402 | 415 | @ParameterizedTest(name = "{index}")
|
403 | 416 | @MethodSource("arangos")
|
404 | 417 | void getLogEntries(ArangoDB arangoDB) {
|
|
0 commit comments