File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
lesson_16/api/api_app/src/test/java/com/codedifferently/lesson16/web Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ void testController_getsAllPatrons() throws Exception {
5151 .perform (get ("/patrons" ).contentType (MediaType .APPLICATION_JSON ))
5252 .andExpect (status ().isOk ())
5353 .andExpect (jsonPath ("$.patrons" ).isArray ())
54- .andExpect (jsonPath ("$.patrons.length()" ).value (4 ));
54+ .andExpect (jsonPath ("$.patrons.length()" ).value (5 ));
5555 }
5656
5757 @ Test
@@ -78,18 +78,18 @@ void testController_reportsBadRequestOnAddPatron() throws Exception {
7878 void testController_addsPatron () throws Exception {
7979 String json =
8080 """
81- {
82- "patron":{
83- "name": "John Book",
84- "email": "johk@reallibrary.org",
85- }
86- }
87- """ ;
81+ {
82+ "patron":{
83+ "name": "John Book",
84+ "email": "johk@reallibrary.org"
85+ }
86+ }
87+ """ ;
8888
8989 mockMvc
9090 .perform (post ("/patrons" ).contentType (MediaType .APPLICATION_JSON ).content (json ))
9191 .andExpect (status ().isOk ())
92- .andExpect (jsonPath ("$.patrons .name" ).value ("John Book" ));
92+ .andExpect (jsonPath ("$.patron .name" ).value ("John Book" ));
9393 }
9494
9595 @ Test
You can’t perform that action at this time.
0 commit comments