Package org.jboss.resteasy.spi

Examples of org.jboss.resteasy.spi.MethodNotAllowedException


               throw new DefaultOptionsMethodException("No resource method found for options, return OK with Allow header", res);
            }
            else
            {
               Response res = Response.status(HttpResponseCodes.SC_METHOD_NOT_ALLOWED).header(HttpHeaderNames.ALLOW, allowHeaderValue).build();
               throw new MethodNotAllowedException("No resource method found for " + httpMethod + ", return 405 with Allow header", res);
            }
         }
         else if (!consumeMatch)
         {
            throw new UnsupportedMediaTypeException("Cannot consume content type");
View Full Code Here


               throw new DefaultOptionsMethodException("No resource method found for options, return OK with Allow header", res);
            }
            else
            {
               Response res = Response.status(HttpResponseCodes.SC_METHOD_NOT_ALLOWED).header(HttpHeaderNames.ALLOW, allowHeaderValue).build();
               throw new MethodNotAllowedException("No resource method found for " + httpMethod + ", return 405 with Allow header", res);
            }
         }
         else if (!consumeMatch)
         {
            throw new UnsupportedMediaTypeException("Cannot consume content type");
View Full Code Here

public class MethodNotAllowedExceptionMapperTest extends
    TestExceptionMapperBase {

    @Test
    public void handleMethodNotAllowed() {
        MethodNotAllowedException mnae = new MethodNotAllowedException("not allowed");
        MethodNotAllowedExceptionMapper mnaem =
            injector.getInstance(MethodNotAllowedExceptionMapper.class);
        Response r = mnaem.toResponse(mnae);
        assertEquals(405, r.getStatus());
        verifyMessage(r, rtmsg("not allowed"));
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.spi.MethodNotAllowedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.