[KEYCLOAK-4902] - Only set effect if result exists and removing ignore from tests
This commit is contained in:
parent
457c6a9d80
commit
3c2339ba33
2 changed files with 10 additions and 3 deletions
|
@ -86,7 +86,16 @@ public class Result {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PolicyResult policy(Policy policy, Effect effect) {
|
public PolicyResult policy(Policy policy, Effect effect) {
|
||||||
return associatedPolicies.computeIfAbsent(policy.getId(), id -> new PolicyResult(policy, effect));
|
PolicyResult policyResult = associatedPolicies.get(policy.getId());
|
||||||
|
|
||||||
|
if (policyResult == null) {
|
||||||
|
policyResult = new PolicyResult(policy, effect);
|
||||||
|
associatedPolicies.put(policy.getId(), policyResult);
|
||||||
|
} else {
|
||||||
|
policyResult.setEffect(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
return policyResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Policy getPolicy() {
|
public Policy getPolicy() {
|
||||||
|
|
|
@ -369,7 +369,6 @@ public abstract class AbstractPhotozExampleAdapterTest extends AbstractExampleAd
|
||||||
assertThat(getResourcesOfUser("alice"), is(empty()));
|
assertThat(getResourcesOfUser("alice"), is(empty()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
public void testClientRoleRepresentingUserConsent() throws Exception {
|
public void testClientRoleRepresentingUserConsent() throws Exception {
|
||||||
ContainerAssume.assumeNotAuthServerUndertow();
|
ContainerAssume.assumeNotAuthServerUndertow();
|
||||||
|
@ -402,7 +401,6 @@ public abstract class AbstractPhotozExampleAdapterTest extends AbstractExampleAd
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
public void testClientRoleNotRequired() throws Exception {
|
public void testClientRoleNotRequired() throws Exception {
|
||||||
loginToClientPage("alice", "alice");
|
loginToClientPage("alice", "alice");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue