Search in sources :

Example 6 with NeverThrowsException

use of org.forgerock.util.promise.NeverThrowsException in project OpenAM by OpenRock.

the class RestRouterIT method shouldNotBePossibleToReachInternalResourceViaChf.

@Test
public void shouldNotBePossibleToReachInternalResourceViaChf() throws Exception {
    // Given
    Context context = mockContext();
    Request request = newRequest("GET", "/json/internal");
    // When
    Promise<Response, NeverThrowsException> promise = handler.handle(context, request);
    // Then
    Response response = promise.get();
    assertThat(response.getStatus()).isEqualTo(Status.NOT_FOUND);
    verifyZeroInteractions(internalResource);
}
Also used : RootContext(org.forgerock.services.context.RootContext) RequestAuditContext(org.forgerock.services.context.RequestAuditContext) HttpContext(org.forgerock.json.resource.http.HttpContext) SessionContext(org.forgerock.http.session.SessionContext) SSOTokenContext(org.forgerock.openam.rest.resource.SSOTokenContext) AttributesContext(org.forgerock.services.context.AttributesContext) SecurityContext(org.forgerock.services.context.SecurityContext) Context(org.forgerock.services.context.Context) Responses.newResourceResponse(org.forgerock.json.resource.Responses.newResourceResponse) Response(org.forgerock.http.protocol.Response) ResourceResponse(org.forgerock.json.resource.ResourceResponse) NeverThrowsException(org.forgerock.util.promise.NeverThrowsException) Request(org.forgerock.http.protocol.Request) ReadRequest(org.forgerock.json.resource.ReadRequest) HttpServletRequest(javax.servlet.http.HttpServletRequest) Test(org.testng.annotations.Test)

Aggregations

NeverThrowsException (org.forgerock.util.promise.NeverThrowsException)6 Response (org.forgerock.http.protocol.Response)4 Request (org.forgerock.http.protocol.Request)3 Context (org.forgerock.services.context.Context)3 Handler (org.forgerock.http.Handler)2 Function (org.forgerock.util.Function)2 Provider (com.google.inject.Provider)1 TypeLiteral (com.google.inject.TypeLiteral)1 FactoryModuleBuilder (com.google.inject.assistedinject.FactoryModuleBuilder)1 ServerSessionOperationStrategy (com.iplanet.dpro.session.operations.ServerSessionOperationStrategy)1 SessionOperationStrategy (com.iplanet.dpro.session.operations.SessionOperationStrategy)1 SessionService (com.iplanet.dpro.session.service.SessionService)1 LDAPServiceException (com.iplanet.services.ldap.LDAPServiceException)1 SSOException (com.iplanet.sso.SSOException)1 EntitlementException (com.sun.identity.entitlement.EntitlementException)1 URLValidator (com.sun.identity.shared.validation.URLValidator)1 ServiceManagementDAOWrapper (com.sun.identity.sm.ServiceManagementDAOWrapper)1 ConfigAuditorFactory (com.sun.identity.sm.ldap.ConfigAuditorFactory)1 Annotation (java.lang.annotation.Annotation)1 ArrayList (java.util.ArrayList)1