Skip to content
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

fix(java-sdk): fix integration test failure for write_and_expand #227

Merged
merged 2 commits into from
Oct 26, 2023
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
22 changes: 22 additions & 0 deletions config/clients/java/template/build.gradle.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ testing {
// See also: https://github.com/PGSSoft/HttpClientMock/issues/3
implementation "com.pgs-soft:HttpClientMock:1.0.0"
}

targets {
all {
testTask.configure {
testLogging {
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showStandardStreams = true
}
}
}
}
}
integration(JvmTestSuite) {
testType = TestSuiteType.INTEGRATION_TEST
Expand All @@ -112,6 +123,17 @@ testing {
srcDirs = ['src/test-integration/java']
}
}

targets {
all {
testTask.configure {
testLogging {
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showStandardStreams = true
}
}
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,17 @@ public class OpenFgaClientIntegrationTest {
ClientExpandResponse response = fga.expand(expandRequest).get();

// Then
assertNotNull(response);
assertNotNull(response.getTree());
assertEquals(
"{\"tree\":{\"root\":{\"name\":\"document:2021-budget#reader\",\"leaf\":{\"users\":{\"users\":[\"user:81684243-9356-4421-8fbf-a4f8d36aa31b\"]}}}}}",
response.getRawResponse());
assertNotNull(response.getTree().getRoot());
var root = response.getTree().getRoot();
assertEquals(DEFAULT_DOC + "#reader", root.getName());
assertNotNull(root.getLeaf());
assertNotNull(root.getLeaf().getUsers());
assertNotNull(root.getLeaf().getUsers().getUsers());
var users = root.getLeaf().getUsers().getUsers();
assertEquals(1, users.size());
assertEquals(DEFAULT_USER, users.get(0));
}

@Test
Expand Down
Loading