Upgrade to Hamcrest 1.3
This commit is contained in:
@@ -34,7 +34,7 @@ configure(allprojects) {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile "org.hamcrest:hamcrest-all:1.1"
|
||||
testCompile "org.hamcrest:hamcrest-all:1.3"
|
||||
testCompile "org.easymock:easymock:2.5.1"
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standaloneSetup;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -60,11 +61,10 @@ public class StatusAssertionTests {
|
||||
this.mockMvc.perform(get("/badRequest")).andExpect(status().isBadRequest());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testMatcher() throws Exception {
|
||||
this.mockMvc.perform(get("/badRequest"))
|
||||
.andExpect(status().is(allOf(greaterThanOrEqualTo(400), lessThan(500))));
|
||||
Matcher<Integer> matcher = allOf(greaterThanOrEqualTo(400), lessThan(500));
|
||||
this.mockMvc.perform(get("/badRequest")).andExpect(status().is(matcher));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user