Skip to content

Commit

Permalink
Impact updates from fcrepo refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Woods committed Sep 25, 2014
1 parent 283fe22 commit 48dc383
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 39 deletions.
37 changes: 6 additions & 31 deletions pom.xml
Expand Up @@ -57,32 +57,6 @@
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.5.5</version>
<exclusions>
<exclusion>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.5.5</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -122,11 +96,6 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-cachestore-leveldb</artifactId>
Expand All @@ -146,6 +115,12 @@
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-http-api</artifactId>
<version>4.0.0-beta-04-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-auth-common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/fcrepo/auth/xacml/PDPFactory.java
Expand Up @@ -50,7 +50,7 @@ public class PDPFactory {
* @see org.springframework.beans.factory.FactoryBean#getObject()
* @return the PDP
*/
public final PDP makePDP() {
public PDP makePDP() {
final PolicyFinder policyFinder = new PolicyFinder();
policyFinder.setModules(Collections.singleton(fedoraPolicyFinderModule));

Expand Down
Expand Up @@ -37,20 +37,14 @@
import org.jboss.security.xacml.sunxacml.ctx.Result;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.modeshape.jcr.api.Session;
import org.modeshape.jcr.api.Workspace;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

/**
* @author Andrew Woods
* Date: 5/9/14
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({PDPFactory.class})
public class XACMLAuthorizationDelegateTest {


Expand All @@ -62,6 +56,7 @@ public class XACMLAuthorizationDelegateTest {
@Mock
private FedoraResourceFinderModule mockFedoraRFM;

@Mock
private PDPFactory mockPdpFactory;

@Mock
Expand Down Expand Up @@ -94,7 +89,8 @@ public class XACMLAuthorizationDelegateTest {
@Before
public void setUp() throws Exception {
initMocks(this);
mockPdpFactory = PowerMockito.mock(PDPFactory.class);
setField(mockPdpFactory, "fedoraPolicyFinderModule", mockFedoraPFM);
setField(mockPdpFactory, "fedoraResourceFinderModule", mockFedoraRFM);
when(mockPdpFactory.makePDP()).thenReturn(mockPdp);
when(mockPdp.evaluate(any(EvaluationCtx.class))).thenReturn(mockResponseCtx);
when(mockResponseCtx.getResults()).thenReturn(getFakeResultSet());
Expand Down

0 comments on commit 48dc383

Please sign in to comment.