EntitlementServiceTest.java revision da2818d9363a5ce6d77d2273e2d5a1cb3d83bbe8
2N/A/**
2N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2N/A *
2N/A * Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
2N/A *
2N/A * The contents of this file are subject to the terms
2N/A * of the Common Development and Distribution License
2N/A * (the License). You may not use this file except in
2N/A * compliance with the License.
2N/A *
2N/A * You can obtain a copy of the License at
2N/A * https://opensso.dev.java.net/public/CDDLv1.0.html or
2N/A * opensso/legal/CDDLv1.0.txt
2N/A * See the License for the specific language governing
2N/A * permission and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL
2N/A * Header Notice in each file and include the License file
2N/A * at opensso/legal/CDDLv1.0.txt.
2N/A * If applicable, add the following below the CDDL Header,
2N/A * with the fields enclosed by brackets [] replaced by
2N/A * your own identifying information:
2N/A * "Portions Copyrighted [year] [name of copyright owner]"
2N/A *
2N/A * $Id: EntitlementServiceTest.java,v 1.1 2009/08/19 05:41:01 veiming Exp $
2N/A *
2N/A * Portions Copyrighted 2016 ForgeRock AS.
2N/A */
2N/A
2N/Apackage com.sun.identity.entitlement.opensso;
2N/A
2N/Aimport com.iplanet.sso.SSOToken;
2N/Aimport com.sun.identity.entitlement.EntitlementConfiguration;
2N/Aimport com.sun.identity.security.AdminTokenAction;
2N/Aimport com.sun.identity.unittest.UnittestLog;
2N/Aimport java.security.AccessController;
2N/Aimport org.testng.annotations.Test;
2N/A
2N/Apublic class EntitlementServiceTest {
2N/A @Test
2N/A public void hasEntitlementDITs() {
2N/A SSOToken adminToken = (SSOToken) AccessController.doPrivileged(
2N/A AdminTokenAction.getInstance());
2N/A
2N/A EntitlementConfiguration ec = new EntitlementService(SubjectUtils.createSubject(adminToken), "/");
2N/A boolean result = ec.hasEntitlementDITs();
2N/A UnittestLog.logMessage(
2N/A "EntitlementServiceTest.hasEntitlementDITs: returns " + result);
2N/A }
2N/A
2N/A}