Example usage for javax.servlet.http HttpServletResponse SC_PAYMENT_REQUIRED

List of usage examples for javax.servlet.http HttpServletResponse SC_PAYMENT_REQUIRED

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletResponse SC_PAYMENT_REQUIRED.

Prototype

int SC_PAYMENT_REQUIRED

To view the source code for javax.servlet.http HttpServletResponse SC_PAYMENT_REQUIRED.

Click Source Link

Document

Status code (402) reserved for future use.

Usage

From source file:io.airlift.http.server.TestHttpServerProvider.java

@Test
public void testFilter() throws Exception {
    createServer();/*ww w  .  ja  va2  s  . c  o  m*/
    server.start();

    try (JettyHttpClient client = new JettyHttpClient()) {
        StatusResponse response = client.execute(
                prepareGet().setUri(httpServerInfo.getHttpUri().resolve("/filter")).build(),
                createStatusResponseHandler());

        assertEquals(response.getStatusCode(), HttpServletResponse.SC_PAYMENT_REQUIRED);
        assertEquals(response.getStatusMessage(), "filtered");
    }
}

From source file:com.proofpoint.http.server.TestHttpServerProvider.java

@Test
public void testFilter() throws Exception {
    createServer();/*from www. j a  va  2 s.co  m*/
    server.start();

    HttpClient client = new ApacheHttpClient();
    StatusResponse response = client.execute(
            prepareGet().setUri(httpServerInfo.getHttpUri().resolve("/filter")).build(),
            createStatusResponseHandler());

    assertEquals(response.getStatusCode(), HttpServletResponse.SC_PAYMENT_REQUIRED);
    assertEquals(response.getStatusMessage(), "filtered");
}