Package org.jboss.resteasy.mock

Examples of org.jboss.resteasy.mock.MockHttpRequest.accept()


   {
      MockHttpRequest request = null;
      try
      {
         request = MockHttpRequest.create(httpMethod, path).contentType(contentType);
         request.accept(accepts);
      }
      catch (URISyntaxException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here


 

  private void assertCharset(String path) throws URISyntaxException {
    for (String characterSet : characterSets) {
      MockHttpRequest request = MockHttpRequest.get(path);
      request.accept("application/xml");
      request.header("Accept-Charset", characterSet);
   
      MockHttpResponse response = new MockHttpResponse();
      dispatcher.invoke(request, response);
      assertEquals("Status code.", 200, response.getStatus());
View Full Code Here

 

  private void assertCharset(String path) throws URISyntaxException {
    for (String characterSet : characterSets) {
      MockHttpRequest request = MockHttpRequest.get(path);
      request.accept("application/xml");
      request.header("Accept-Charset", characterSet);
   
      MockHttpResponse response = new MockHttpResponse();
      dispatcher.invoke(request, response);
      assertEquals("Status code.", 200, response.getStatus());
View Full Code Here

      List<MediaType> expected = Arrays.asList(MediaType.TEXT_XML_TYPE, MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_HTML_TYPE, MediaType.APPLICATION_XHTML_XML_TYPE);

      MockHttpRequest request = MockHttpRequest.get("foo?" + acceptParamName + "=" + expected.get(0) + "," + expected.get(1));
      PreMatchContainerRequestContext context = new PreMatchContainerRequestContext(request);

      request.accept(expected.get(2));
      request.accept(expected.get(3));

      processor.filter(context);

      List<MediaType> actual = request.getHttpHeaders().getAcceptableMediaTypes();
View Full Code Here

      MockHttpRequest request = MockHttpRequest.get("foo?" + acceptParamName + "=" + expected.get(0) + "," + expected.get(1));
      PreMatchContainerRequestContext context = new PreMatchContainerRequestContext(request);

      request.accept(expected.get(2));
      request.accept(expected.get(3));

      processor.filter(context);

      List<MediaType> actual = request.getHttpHeaders().getAcceptableMediaTypes();
View Full Code Here

      List<MediaType> expected = Arrays.asList(MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_HTML_TYPE);

      MockHttpRequest request = MockHttpRequest.get("foo");
      PreMatchContainerRequestContext context = new PreMatchContainerRequestContext(request);
      request.accept(expected.get(0));
      request.accept(expected.get(1));

      processor.filter(context);

      List<MediaType> actual = request.getHttpHeaders().getAcceptableMediaTypes();
View Full Code Here

      List<MediaType> expected = Arrays.asList(MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_HTML_TYPE);

      MockHttpRequest request = MockHttpRequest.get("foo");
      PreMatchContainerRequestContext context = new PreMatchContainerRequestContext(request);
      request.accept(expected.get(0));
      request.accept(expected.get(1));

      processor.filter(context);

      List<MediaType> actual = request.getHttpHeaders().getAcceptableMediaTypes();
View Full Code Here

   {
      MockHttpRequest request = null;
      try
      {
         request = MockHttpRequest.create(httpMethod, path).contentType(contentType);
         request.accept(accepts);
      }
      catch (URISyntaxException e)
      {
         throw new RuntimeException(e);
      }
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.