/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.liferay.portal.security.sso.openid.internal.verify.test; import com.liferay.arquillian.extension.junit.bridge.junit.Arquillian; import com.liferay.portal.kernel.settings.Settings; import com.liferay.portal.kernel.test.rule.AggregateTestRule; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.UnicodeProperties; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.security.sso.openid.constants.LegacyOpenIdPropsKeys; import com.liferay.portal.security.sso.openid.constants.OpenIdConfigurationKeys; import com.liferay.portal.security.sso.openid.constants.OpenIdConstants; import com.liferay.portal.test.rule.LiferayIntegrationTestRule; import com.liferay.portal.verify.test.BaseCompanySettingsVerifyProcessTestCase; import javax.portlet.PortletPreferences; import org.junit.Assert; import org.junit.ClassRule; import org.junit.Rule; import org.junit.runner.RunWith; /** * @author Stian Sigvartsen */ @RunWith(Arquillian.class) public class OpenIdCompanySettingsVerifyProcessTest extends BaseCompanySettingsVerifyProcessTestCase { @ClassRule @Rule public static final AggregateTestRule aggregateTestRule = new LiferayIntegrationTestRule(); @Override protected void doVerify( PortletPreferences portletPreferences, Settings settings) { Assert.assertTrue( Validator.isNull( portletPreferences.getValue( LegacyOpenIdPropsKeys.OPENID_AUTH_ENABLED, StringPool.BLANK))); Assert.assertEquals( StringPool.TRUE, settings.getValue( OpenIdConfigurationKeys.AUTH_ENABLED, StringPool.FALSE)); } @Override protected String getSettingsId() { return OpenIdConstants.SERVICE_NAME; } @Override protected String getVerifyProcessName() { return "com.liferay.portal.security.sso.openid"; } @Override protected void populateLegacyProperties(UnicodeProperties properties) { properties.put(LegacyOpenIdPropsKeys.OPENID_AUTH_ENABLED, "true"); } }