当前位置: 首页>>代码示例>>Java>>正文


Java HttpAction.forbidden方法代码示例

本文整理汇总了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();
    });

}
 
开发者ID:millross,项目名称:pac4j-async,代码行数:17,代码来源:AsyncExceptionHandlerTest.java

示例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();
    });
}
 
开发者ID:millross,项目名称:pac4j-async,代码行数:13,代码来源:AsyncExceptionHandlerTest.java

示例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);
}
 
开发者ID:e-gov,项目名称:TARA-Server,代码行数:4,代码来源:DefaultSecurityLogic.java

示例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);
}
 
开发者ID:millross,项目名称:pac4j-async,代码行数:11,代码来源:DefaultAsyncSecurityLogic.java

示例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);
}
 
开发者ID:yaochi,项目名称:pac4j-plus,代码行数:13,代码来源:DefaultSecurityLogic.java


注:本文中的org.pac4j.core.exception.HttpAction.forbidden方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。