Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

story 74774960. Create PDPFactory Unit Test. #21

Merged
merged 1 commit into from Jul 14, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/test/java/org/fcrepo/auth/xacml/PDPFactoryTest.java
@@ -0,0 +1,48 @@
/**
* Copyright 2014 DuraSpace, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.fcrepo.auth.xacml;


import static org.fcrepo.kernel.utils.TestHelpers.setField;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;

import org.jboss.security.xacml.sunxacml.PDP;
import org.junit.Before;
import org.junit.Test;

/**
* Created by mohideen on 7/11/14.
*/
public class PDPFactoryTest {

private PDPFactory pdpFactory;

@Before
public void setUp() {
pdpFactory = new PDPFactory();
FedoraPolicyFinderModule fedoraPolicyFinderModule = new FedoraPolicyFinderModule();
FedoraResourceFinderModule fedoraResourceFinderModule = new FedoraResourceFinderModule();
setField(pdpFactory, "fedoraPolicyFinderModule", fedoraPolicyFinderModule);
setField(pdpFactory, "fedoraResourceFinderModule", fedoraResourceFinderModule);
}

@Test
public void testMakePdp() {
assertThat(pdpFactory.makePDP(), instanceOf(PDP.class));
}

}