KEYCLOAK-7616 fix NPE for UserStorageConsentTest

This commit is contained in:
vramik 2018-06-13 13:16:11 +02:00 committed by Marek Posolda
parent fb883254f6
commit ccb09fbf45

View file

@ -117,6 +117,7 @@ public class UserStorageConsentTest extends AbstractServletsAdapterTest {
ClientModel product = session.realms().getClientByClientId("product-portal", realm);
product.setConsentRequired(true);
ClientScopeModel clientScope = realm.addClientScope("clientScope");
clientScope.setProtocol(OIDCLoginProtocol.LOGIN_PROTOCOL);
System.err.println("client scope protocol mappers size: " + clientScope.getProtocolMappers().size());
for (ProtocolMapperModel mapper : product.getProtocolMappers()) {
@ -163,7 +164,7 @@ public class UserStorageConsentTest extends AbstractServletsAdapterTest {
productPortal.navigateTo();
assertCurrentUrlStartsWithLoginUrlOf(testRealmPage);
testRealmLoginPage.form().login("memuser", "password");
org.keycloak.testsuite.Assert.assertTrue(consentPage.isCurrent());
Assert.assertTrue(consentPage.isCurrent());
consentPage.confirm();
assertCurrentUrlEquals(productPortal.toString());
Assert.assertTrue(driver.getPageSource().contains("iPhone"));