Search in sources :

Example 1 with QueryAttribute

use of org.forgerock.openam.entitlement.rest.query.QueryAttribute in project OpenAM by OpenRock.

the class PrivilegePolicyStoreTest method setupMocks.

@BeforeMethod
public void setupMocks() {
    mockManager = mock(PrivilegeManager.class);
    Map<String, QueryAttribute> queryAttributes = new HashMap<String, QueryAttribute>();
    queryAttributes.put(STRING_ATTRIBUTE, new QueryAttribute(AttributeType.STRING, STRING_SEARCH_ATTRIBUTE));
    queryAttributes.put(NUMERIC_ATTRIBUTE, new QueryAttribute(AttributeType.NUMBER, NUMERIC_SEARCH_ATTRIBUTE));
    queryAttributes.put(DATE_ATTRIBUTE, new QueryAttribute(AttributeType.TIMESTAMP, DATE_SEARCH_ATTRIBUTE));
    testStore = new PrivilegePolicyStore(mockManager, queryAttributes);
}
Also used : HashMap(java.util.HashMap) PrivilegeManager(com.sun.identity.entitlement.PrivilegeManager) QueryAttribute(org.forgerock.openam.entitlement.rest.query.QueryAttribute) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with QueryAttribute

use of org.forgerock.openam.entitlement.rest.query.QueryAttribute in project OpenAM by OpenRock.

the class ApplicationsResourceTest method setUp.

@BeforeMethod
public void setUp() {
    debug = mock(Debug.class);
    applicationManagerWrapper = mock(ApplicationManagerWrapper.class);
    applicationTypeManagerWrapper = mock(ApplicationTypeManagerWrapper.class);
    applicationWrapper = mock(ApplicationWrapper.class);
    queryAttributes = new HashMap<String, QueryAttribute>();
    queryAttributes.put(STRING_ATTRIBUTE, new QueryAttribute(AttributeType.STRING, new SearchAttribute(STRING_ATTRIBUTE, "ou")));
    queryAttributes.put(NUMERIC_ATTRIBUTE, new QueryAttribute(AttributeType.NUMBER, new SearchAttribute(NUMERIC_ATTRIBUTE, "ou")));
    queryAttributes.put(DATE_ATTRIBUTE, new QueryAttribute(AttributeType.TIMESTAMP, new SearchAttribute(DATE_ATTRIBUTE, "ou")));
    applicationsResource = new ApplicationsResource(debug, applicationManagerWrapper, applicationTypeManagerWrapper, queryAttributes, resourceErrorHandler) {

        @Override
        protected ApplicationWrapper createApplicationWrapper(JsonValue jsonValue, Subject mySubject) throws EntitlementException {
            return applicationWrapper;
        }
    };
}
Also used : ApplicationTypeManagerWrapper(org.forgerock.openam.entitlement.rest.wrappers.ApplicationTypeManagerWrapper) JsonValue(org.forgerock.json.JsonValue) Matchers.anyString(org.mockito.Matchers.anyString) ApplicationManagerWrapper(org.forgerock.openam.entitlement.rest.wrappers.ApplicationManagerWrapper) Subject(javax.security.auth.Subject) SearchAttribute(com.sun.identity.entitlement.util.SearchAttribute) EntitlementException(com.sun.identity.entitlement.EntitlementException) ApplicationWrapper(org.forgerock.openam.entitlement.rest.wrappers.ApplicationWrapper) QueryAttribute(org.forgerock.openam.entitlement.rest.query.QueryAttribute) Debug(com.sun.identity.shared.debug.Debug) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

QueryAttribute (org.forgerock.openam.entitlement.rest.query.QueryAttribute)2 BeforeMethod (org.testng.annotations.BeforeMethod)2 EntitlementException (com.sun.identity.entitlement.EntitlementException)1 PrivilegeManager (com.sun.identity.entitlement.PrivilegeManager)1 SearchAttribute (com.sun.identity.entitlement.util.SearchAttribute)1 Debug (com.sun.identity.shared.debug.Debug)1 HashMap (java.util.HashMap)1 Subject (javax.security.auth.Subject)1 JsonValue (org.forgerock.json.JsonValue)1 ApplicationManagerWrapper (org.forgerock.openam.entitlement.rest.wrappers.ApplicationManagerWrapper)1 ApplicationTypeManagerWrapper (org.forgerock.openam.entitlement.rest.wrappers.ApplicationTypeManagerWrapper)1 ApplicationWrapper (org.forgerock.openam.entitlement.rest.wrappers.ApplicationWrapper)1 Matchers.anyString (org.mockito.Matchers.anyString)1