本文整理汇总了Java中org.pac4j.core.exception.HttpAction.forbidden方法的典型用法代码示例。如果您正苦于以下问题:Java HttpAction.forbidden方法的具体用法?Java HttpAction.forbidden怎么用?Java HttpAction.forbidden使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pac4j.core.exception.HttpAction
的用法示例。
在下文中一共展示了HttpAction.forbidden方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testOtherExceptionThrownDuringResultTransformation
import org.pac4j.core.exception.HttpAction; //导入方法依赖的package包/类
@Test(timeout = 1000)
public void testOtherExceptionThrownDuringResultTransformation(final TestContext testContext) {
final Async async = testContext.async();
final AsyncWebContext asyncWebContext = MockAsyncWebContextBuilder.from(rule.vertx(), asynchronousComputationAdapter).build();
final HttpAction forbiddenAction = HttpAction.forbidden("Forbidden", asyncWebContext);
final CompletableFuture<HttpAction> okFuture = this.<Integer>delayedResult(100, () -> 2)
.<HttpAction>thenApply(v -> {
throw forbiddenAction;
})
.handle(softenBiFunction(AsyncExceptionHandler::extractAsyncHttpAction));
okFuture.thenAccept(a -> {
assertThat(a.getCode(), is(403));
async.complete();
});
}
示例2: testExtractHttpActionOnHttpActionExceptionalCompletion
import org.pac4j.core.exception.HttpAction; //导入方法依赖的package包/类
@Test(timeout = 1000)
public void testExtractHttpActionOnHttpActionExceptionalCompletion(final TestContext testContext) {
final Async async = testContext.async();
final AsyncWebContext asyncWebContext = MockAsyncWebContextBuilder.from(rule.vertx(), asynchronousComputationAdapter).build();
final HttpAction forbiddenAction = HttpAction.forbidden("Forbidden", asyncWebContext);
final CompletableFuture<HttpAction> okFuture = this.<HttpAction>delayedException(100, forbiddenAction)
.handle(softenBiFunction(AsyncExceptionHandler::extractAsyncHttpAction));
okFuture.thenAccept(a -> {
assertThat(a.getCode(), is(403));
async.complete();
});
}
示例3: forbidden
import org.pac4j.core.exception.HttpAction; //导入方法依赖的package包/类
protected HttpAction forbidden(C context, List<Client> currentClients, List<CommonProfile> profiles, String authorizers) throws HttpAction {
return HttpAction.forbidden("forbidden", context);
}
示例4: forbidden
import org.pac4j.core.exception.HttpAction; //导入方法依赖的package包/类
/**
* Return a forbidden error.
*
* @param context the web context
* @return a forbidden error
* @throws HttpAction whether an additional HTTP action is required
*/
protected HttpAction forbidden(final C context) throws HttpAction {
return HttpAction.forbidden("forbidden", context);
}
示例5: forbidden
import org.pac4j.core.exception.HttpAction; //导入方法依赖的package包/类
/**
* Return a forbidden error.
*
* @param context the web context
* @param currentClients the current clients
* @param profiles the current profiles
* @param authorizers the authorizers
* @return a forbidden error
*/
protected HttpAction forbidden(final C context, final List<Client> currentClients, final List<CommonProfile> profiles, final String authorizers) {
return HttpAction.forbidden("forbidden", context);
}