use of org.springframework.mock.web.test.MockHttpServletRequest in project spring-framework by spring-projects.
the class HeadersRequestConditionTests method headerCaseSensitiveValueMatch.
@Test
public void headerCaseSensitiveValueMatch() {
HeadersRequestCondition condition = new HeadersRequestCondition("foo=Bar");
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader("foo", "bar");
assertNull(condition.getMatchingCondition(request));
}
use of org.springframework.mock.web.test.MockHttpServletRequest in project spring-framework by spring-projects.
the class ParamsRequestConditionTests method paramValueMatch.
@Test
public void paramValueMatch() {
MockHttpServletRequest request = new MockHttpServletRequest();
request.addParameter("foo", "bar");
assertNotNull(new ParamsRequestCondition("foo=bar").getMatchingCondition(request));
}
use of org.springframework.mock.web.test.MockHttpServletRequest in project spring-framework by spring-projects.
the class ParamsRequestConditionTests method paramValueNoMatch.
@Test
public void paramValueNoMatch() {
MockHttpServletRequest request = new MockHttpServletRequest();
request.addParameter("foo", "bazz");
assertNull(new ParamsRequestCondition("foo=bar").getMatchingCondition(request));
}
use of org.springframework.mock.web.test.MockHttpServletRequest in project spring-framework by spring-projects.
the class ParamsRequestConditionTests method paramNotPresent.
@Test
public void paramNotPresent() {
ParamsRequestCondition condition = new ParamsRequestCondition("!foo");
MockHttpServletRequest request = new MockHttpServletRequest();
assertNotNull(condition.getMatchingCondition(request));
}
use of org.springframework.mock.web.test.MockHttpServletRequest in project spring-framework by spring-projects.
the class PatternsRequestConditionTests method matchSuffixPatternUsingFileExtensions2.
@Test
public void matchSuffixPatternUsingFileExtensions2() {
PatternsRequestCondition condition1 = new PatternsRequestCondition(new String[] { "/prefix" }, null, null, true, false, Arrays.asList("json"));
PatternsRequestCondition condition2 = new PatternsRequestCondition(new String[] { "/suffix" }, null, null, true, false, null);
PatternsRequestCondition combined = condition1.combine(condition2);
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/prefix/suffix.json");
PatternsRequestCondition match = combined.getMatchingCondition(request);
assertNotNull(match);
}
Aggregations