Skip to content

[DE-886] fix type of AqlExecutionExplainEntity.warnings #579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public final class AqlExecutionExplainEntity {

private ExecutionPlan plan;
private Collection<ExecutionPlan> plans;
private Collection<String> warnings;
private Collection<CursorWarning> warnings;
private ExecutionStats stats;
private Boolean cacheable;

Expand All @@ -41,7 +41,7 @@ public Collection<ExecutionPlan> getPlans() {
return plans;
}

public Collection<String> getWarnings() {
public Collection<CursorWarning> getWarnings() {
return warnings;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,18 @@ void explainQueryWithBindVars(ArangoDatabaseAsync db) throws ExecutionException,
assertThat(plan.getNodes()).isNotEmpty();
}

@ParameterizedTest
@MethodSource("asyncDbs")
void explainQueryWithWarnings(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException {
AqlExecutionExplainEntity explain = db.explainQuery("return 1/0", null, null).get();
assertThat(explain.getWarnings())
.hasSize(1)
.allSatisfy(w -> {
assertThat(w.getCode()).isEqualTo(1562);
assertThat(w.getMessage()).isEqualTo("division by zero");
});
}

@ParameterizedTest
@MethodSource("asyncDbs")
void explainQueryWithIndexNode(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException {
Expand Down
12 changes: 12 additions & 0 deletions test-functional/src/test/java/com/arangodb/ArangoDatabaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,18 @@ void explainQueryWithBindVars(ArangoDatabase db) {
assertThat(plan.getNodes()).isNotEmpty();
}

@ParameterizedTest
@MethodSource("dbs")
void explainQueryWithWarnings(ArangoDatabase db) {
AqlExecutionExplainEntity explain = db.explainQuery("return 1/0", null, null);
assertThat(explain.getWarnings())
.hasSize(1)
.allSatisfy(w -> {
assertThat(w.getCode()).isEqualTo(1562);
assertThat(w.getMessage()).isEqualTo("division by zero");
});
}

@ParameterizedTest
@MethodSource("dbs")
void explainQueryWithIndexNode(ArangoDatabase db) {
Expand Down