Package org.jboss.resteasy.core

Examples of org.jboss.resteasy.core.AcceptParameterHttpPreprocessor.preProcess()


      String type = MediaType.TEXT_XML;
      HttpRequest request = MockHttpRequest.get("foo?" + acceptParamName + "=" + type);

      MediaType mediaType = MediaType.valueOf(type);

      processor.preProcess(request);

      List<MediaType> list = request.getHttpHeaders().getAcceptableMediaTypes();

      Assert.assertEquals("Incorrect acceptable list size", 1, list.size());
      Assert.assertEquals("Incorrect media type extracted", mediaType, list.get(0));
View Full Code Here


      HttpRequest request = MockHttpRequest.get("foo?" + acceptParamName + "=" + expected.get(0) + "," + expected.get(1));
      request.getHttpHeaders().getAcceptableMediaTypes().add(expected.get(2));
      request.getHttpHeaders().getAcceptableMediaTypes().add(expected.get(3));

      processor.preProcess(request);

      List<MediaType> actual = request.getHttpHeaders().getAcceptableMediaTypes();

      Assert.assertEquals("Incorrect acceptable media type extracted", expected, actual);
   }
View Full Code Here

      HttpRequest request = MockHttpRequest.get("foo");
      request.getHttpHeaders().getAcceptableMediaTypes().add(expected.get(0));
      request.getHttpHeaders().getAcceptableMediaTypes().add(expected.get(1));

      processor.preProcess(request);

      List<MediaType> actual = request.getHttpHeaders().getAcceptableMediaTypes();

      Assert.assertEquals("Incorrect acceptable media type extracted", expected, actual);
   }
View Full Code Here

      String param2 = URLEncoder.encode("text/html", "UTF-8");
      HttpRequest request = MockHttpRequest.get(
              "foo?" + acceptParamName + "=" + param1 + "&" +
                      acceptParamName + "=" + param2);

      processor.preProcess(request);

      List<MediaType> actual = request.getHttpHeaders().getAcceptableMediaTypes();

      Assert.assertEquals("Incorrect acceptable media type extracted", expected, actual);
   }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.