Skip to content

Commit

Permalink
fix(java-sdk): update expand test to not use raw response
Browse files Browse the repository at this point in the history
  • Loading branch information
booniepepper committed Oct 25, 2023
1 parent e19c48a commit 1c28893
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,17 @@ public class OpenFgaClientIntegrationTest {
ClientExpandResponse response = fga.expand(expandRequest).get();
// Then
assertNotNull(response);
assertNotNull(response.getTree());
String normalizedResponse = response.getRawResponse().replaceAll("\\s", "");
assertEquals(
"{\"tree\":{\"root\":{\"name\":\"document:2021-budget#reader\",\"leaf\":{\"users\":{\"users\":[\"user:81684243-9356-4421-8fbf-a4f8d36aa31b\"]}}}}}",
normalizedResponse);
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 1c28893

Please sign in to comment.