Package org.springframework.web.servlet.mvc.condition

Examples of org.springframework.web.servlet.mvc.condition.ConsumesRequestCondition


        return new RequestMappingInfo(
          new PatternsRequestCondition(annotation.value(), getUrlPathHelper(), getPathMatcher(), true, true),
          new RequestMethodsRequestCondition(annotation.method()),
          new ParamsRequestCondition(annotation.params()),
          new HeadersRequestCondition(annotation.headers()),
          new ConsumesRequestCondition(annotation.consumes(), annotation.headers()),
          new ProducesRequestCondition(annotation.produces(), annotation.headers()), null);
      }
      else {
        return null;
      }
View Full Code Here


    request.setContentType("text/plain");

    RequestMappingInfo info =
      new RequestMappingInfo(
        new PatternsRequestCondition("/foo"), null, null, null,
        new ConsumesRequestCondition("text/plain"), null, null);
    RequestMappingInfo match = info.getMatchingCondition(request);

    assertNotNull(match);

    info = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"), null, null, null,
        new ConsumesRequestCondition("application/xml"), null, null);
    match = info.getMatchingCondition(request);

    assertNull(match);
  }
View Full Code Here

    RequestMappingInfo info1 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    RequestMappingInfo info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertEquals(info1, info2);
    assertEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo", "/NOOOOOO"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET, RequestMethod.POST),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("/NOOOOOO"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("/NOOOOOO"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/NOOOOOO"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/NOOOOOO"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=NOOOOOO"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.mvc.condition.ConsumesRequestCondition

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.