This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
305d071
commit 338ae44
Showing
3 changed files
with
42 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/test/java/se/bjurr/prnfb/service/MockedEscalatedSecurityContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package se.bjurr.prnfb.service; | ||
|
||
import java.util.Set; | ||
|
||
import com.atlassian.bitbucket.permission.Permission; | ||
import com.atlassian.bitbucket.user.EscalatedSecurityContext; | ||
import com.atlassian.bitbucket.util.Operation; | ||
|
||
public class MockedEscalatedSecurityContext implements EscalatedSecurityContext { | ||
|
||
@Override | ||
public void applyToRequest() {} | ||
|
||
@Override | ||
public <T, E extends Throwable> T call(Operation<T, E> arg0) throws E { | ||
return arg0.perform(); | ||
} | ||
|
||
@Override | ||
public EscalatedSecurityContext withPermission(Object arg0, Permission arg1) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public EscalatedSecurityContext withPermission(Permission arg0) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public EscalatedSecurityContext withPermissions(Set<Permission> arg0) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters