EntitlementCombinerTest.java revision 98889d65f3da34634133fce0bccd5138397bccf6
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2013 ForgeRock Inc.
*/
/**
* Unit tests for the abstract class EntitlementCombiner.
*
* @author andrew.forrest@forgerock.com
*/
public class EntitlementCombinerTest {
private static final boolean SELF_MODE = false;
private EntitlementCombiner combiner;
private Application app;
private ResourceName resourceName;
}
/**
* Given two entitlements both with action values and no advice, a
* single entitlement should be created with action values merged.
*/
@Test
public void addUsingSelfModeNoAdvice() throws EntitlementException {
// Given
// When
// Then
}
/**
* Given two entitlements one with action values and one with advice, a single
* entitlement should be created with no action values but with the advice.
*/
@Test
public void addUsingSelfModeWithAdvice() throws EntitlementException {
// Given
// When
Entitlement eWithoutAdvice = new Entitlement(APP_NAME, "http://test.web.com:8080/hello/*", actionNames);
Entitlement eWithAdvice = new Entitlement(APP_NAME, "http://test.web.com:8080/hello/world/page.html", EMPTY_MAP);
// Then
}
// The invoker allows the test to monitor how the abstract methods are being interacted with.
private static interface Invoker {
/**
* @see EntitlementCombiner
*/
/**
* @see EntitlementCombiner#isCompleted()
*/
public boolean isCompleted();
}
// Given the class under test is abstract, this dumb implementation assists with unit testing.
private static class DumbEntitlementCombiner extends EntitlementCombiner {
}
}
protected boolean isCompleted() {
return invoker.isCompleted();
}
}
}