Package org.jboss.resteasy.mock

Examples of org.jboss.resteasy.mock.MockHttpRequest


   }

   public void oneway(HttpRequest request, HttpResponse response, final ResourceInvoker invoker)
   {
      logger.debug("IN ONE WAY!!!!!");
      final MockHttpRequest in;
      try
      {
         in = MockHttpRequest.deepCopy(request);
      }
      catch (IOException e)
View Full Code Here


      }
   }

   public void postJob(HttpRequest request, HttpResponse response)
   {
      final MockHttpRequest in;
      try
      {
         in = MockHttpRequest.deepCopy(request);
      }
      catch (IOException e)
View Full Code Here

   }

   public void oneway(HttpRequest request, HttpResponse response)
   {
      logger.debug("IN ONE WAY!!!!!");
      final MockHttpRequest in;
      try
      {
         in = MockHttpRequest.deepCopy(request);
      }
      catch (IOException e)
View Full Code Here

        interceptor.preProcess(req, rmethod);
    }

    @Test(expected = BadRequestException.class)
    public void testDoesNotAllowPageZero() throws Exception {
        MockHttpRequest req = MockHttpRequest.create("GET",
            "http://localhost/candlepin/status?page=0&per_page=456");

        interceptor.preProcess(req, rmethod);
    }
View Full Code Here

        interceptor.preProcess(req, rmethod);
    }

    @Test
    public void testNoPagingIfJustOrderAndSortBy() throws Exception {
        MockHttpRequest req = MockHttpRequest.create("GET",
            "http://localhost/candlepin/status?order=asc&sort_by=id");

        interceptor.preProcess(req, rmethod);

        PageRequest p = ResteasyProviderFactory.getContextData(PageRequest.class);
View Full Code Here

        assertEquals("id", p.getSortBy());
    }

    @Test
    public void testUsesDefaultOrderIfNoOrderProvided() throws Exception {
        MockHttpRequest req = MockHttpRequest.create("GET",
            "http://localhost/candlepin/status?sort_by=id");

        interceptor.preProcess(req, rmethod);

        PageRequest p = ResteasyProviderFactory.getContextData(PageRequest.class);
View Full Code Here

        assertEquals("id", p.getSortBy());
    }

    @Test
    public void testDescendingOrder() throws Exception {
        MockHttpRequest req = MockHttpRequest.create("GET",
            "http://localhost/candlepin/status?order=descending&sort_by=id");

        interceptor.preProcess(req, rmethod);

        PageRequest p = ResteasyProviderFactory.getContextData(PageRequest.class);
View Full Code Here

    }

    @Test(expected = UnauthorizedException.class)
    public void noSecurityHoleNoPrincipal() throws Exception {
        Method method = FakeResource.class.getMethod("someMethod", String.class);
        MockHttpRequest req = MockHttpRequest.create("GET",
            "http://localhost/candlepin/status");
        ResourceMethod rmethod = mock(ResourceMethod.class);
        when(rmethod.getMethod()).thenReturn(method);
        Class clazz = FakeResource.class;
        when(rmethod.getResourceClass()).thenReturn(clazz);
View Full Code Here

    }

    @Test
    public void noSecurityHole() throws Exception {
        Method method = FakeResource.class.getMethod("someMethod", String.class);
        MockHttpRequest req = MockHttpRequest.create("GET",
            "http://localhost/candlepin/status");
        req.header("Authorization", "BASIC QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
        ResourceMethod rmethod = mock(ResourceMethod.class);
        when(rmethod.getMethod()).thenReturn(method);
        Class clazz = FakeResource.class;
        when(rmethod.getResourceClass()).thenReturn(clazz);
View Full Code Here

    }

    @Test
    public void securityHoleWithNoAuth() throws Exception {
        Method method = FakeResource.class.getMethod("noAuthMethod", String.class);
        MockHttpRequest req = MockHttpRequest.create("GET",
            "http://localhost/candlepin/status");
        ResourceMethod rmethod = mock(ResourceMethod.class);
        when(rmethod.getMethod()).thenReturn(method);
        Class clazz = FakeResource.class;
        when(rmethod.getResourceClass()).thenReturn(clazz);
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.mock.MockHttpRequest

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.