Skip to content

Commit

Permalink
fix(java-sdk): fix integration test failure for write_and_expand (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh authored Oct 26, 2023
2 parents 598be95 + 1c28893 commit dc29311
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
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

0 comments on commit dc29311

Please sign in to comment.