File tree 1 file changed +3
-3
lines changed
source-code/bean-validation-demo/src/test/java/com/example/beanvalidationdemo
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public void should_check_person_value() throws Exception {
42
42
.classId ("82938390" )
43
43
.region ("Shanghai" )
44
44
.phoneNumber ("1816313815" ).build ();
45
- mockMvc .perform (post ("/api/person " )
45
+ mockMvc .perform (post ("/api/persons " )
46
46
.contentType (MediaType .APPLICATION_JSON )
47
47
.content (objectMapper .writeValueAsString (personRequest )))
48
48
.andExpect (MockMvcResultMatchers .jsonPath ("sex" ).value ("sex 值不在可选范围" ))
@@ -53,15 +53,15 @@ public void should_check_person_value() throws Exception {
53
53
54
54
@ Test
55
55
public void should_check_path_variable () throws Exception {
56
- mockMvc .perform (get ("/api/person /6" )
56
+ mockMvc .perform (get ("/api/persons /6" )
57
57
.contentType (MediaType .APPLICATION_JSON ))
58
58
.andExpect (status ().isBadRequest ())
59
59
.andExpect (content ().string ("getPersonByID.id: 超过 id 的范围了" ));
60
60
}
61
61
62
62
@ Test
63
63
public void should_check_request_param_value2 () throws Exception {
64
- mockMvc .perform (put ("/api/person " )
64
+ mockMvc .perform (put ("/api/persons " )
65
65
.param ("name" , "snailclimbsnailclimb" )
66
66
.contentType (MediaType .APPLICATION_JSON ))
67
67
.andExpect (status ().isBadRequest ())
You can’t perform that action at this time.
0 commit comments