Skip to content

Commit

Permalink
Fixed Unit Test
Browse files Browse the repository at this point in the history
  • Loading branch information
f11h committed Jul 27, 2023
1 parent dcb6b46 commit 703e1b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ private void assertRealm() {
.size();
assertThat(createdScopesCount, is(4));

int createdPoliciesCount = createdRealm
long createdPoliciesCount = createdRealm
.getClients()
.stream().filter(client -> Objects.equals(client.getName(), "moped-client")).findAny()
.orElseThrow(() -> new RuntimeException("Cannot find client 'moped-client'"))
.getAuthorizationSettings().getPolicies()
.size();
assertThat(createdPoliciesCount, is(1));
.getAuthorizationSettings().getPolicies().stream()
.filter(policy -> !policy.getName().equals("Default Policy"))
.filter(policy -> !policy.getName().equals("Default Permission"))
.count();
assertThat(createdPoliciesCount, is(1L));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,12 @@
"policies": [
{
"name": "Policy A",
"description": "Test Policy for testing purpose",
"type": "user",
"description": "",
"type": "client",
"logic": "POSITIVE",
"decisionStrategy": "UNANIMOUS",
"config": {
"users": "[\"moped.user\"]"
"clients": "[\"moped-client\"]"
}
}
],
Expand Down

0 comments on commit 703e1b9

Please sign in to comment.