Fixing ClientPoliciesTest failure (#12670)
Closes #10633 Co-authored-by: wojnarfilip <fwojnar@redhat.com>
This commit is contained in:
parent
29aad9dc45
commit
7fccdb10d8
1 changed files with 6 additions and 3 deletions
|
@ -25,6 +25,7 @@ import org.keycloak.authentication.authenticators.client.ClientIdAndSecretAuthen
|
|||
import org.keycloak.authentication.authenticators.client.JWTClientAuthenticator;
|
||||
import org.keycloak.representations.idm.ClientPoliciesRepresentation;
|
||||
import org.keycloak.representations.idm.ClientProfilesRepresentation;
|
||||
import org.keycloak.representations.idm.ClientPolicyConditionConfigurationRepresentation;
|
||||
import org.keycloak.services.clientpolicy.condition.ClientAccessTypeConditionFactory;
|
||||
import org.keycloak.services.clientpolicy.executor.HolderOfKeyEnforcerExecutorFactory;
|
||||
import org.keycloak.services.clientpolicy.executor.SecureClientAuthenticatorExecutorFactory;
|
||||
|
@ -316,15 +317,17 @@ public class ClientPoliciesTest extends AbstractRealmTest {
|
|||
assertAlertSuccess();
|
||||
|
||||
// assert JSON
|
||||
ClientPolicyConditionConfigurationRepresentation conditionConfig =
|
||||
createClientAccessTypeConditionConfig(Arrays.asList(ClientAccessTypeConditionFactory.TYPE_CONFIDENTIAL, ClientAccessTypeConditionFactory.TYPE_BEARERONLY, ClientAccessTypeConditionFactory.TYPE_PUBLIC));
|
||||
conditionConfig.setNegativeLogic(Boolean.FALSE);
|
||||
|
||||
ClientPoliciesRepresentation expected = new ClientPoliciesBuilder()
|
||||
.addPolicy(new ClientPolicyBuilder()
|
||||
.createPolicy(policyName, policyDesc, true)
|
||||
.addCondition(ClientAccessTypeConditionFactory.PROVIDER_ID,
|
||||
createClientAccessTypeConditionConfig(Arrays.asList(ClientAccessTypeConditionFactory.TYPE_CONFIDENTIAL, ClientAccessTypeConditionFactory.TYPE_BEARERONLY, ClientAccessTypeConditionFactory.TYPE_PUBLIC)))
|
||||
.addCondition(ClientAccessTypeConditionFactory.PROVIDER_ID, conditionConfig)
|
||||
.addProfile(profileName)
|
||||
.toRepresentation())
|
||||
.toRepresentation();
|
||||
|
||||
assertClientPolicy(expected);
|
||||
|
||||
// remove condition
|
||||
|
|
Loading…
Reference in a new issue