File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
lesson_16/api/api_app/src/test/java/com/codedifferently/lesson16/web Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ void testController_getsAllPatrons() throws Exception {
54
54
.perform (get ("/patrons" ).contentType (MediaType .APPLICATION_JSON ))
55
55
.andExpect (status ().isOk ())
56
56
.andExpect (jsonPath ("$.patrons" ).isArray ())
57
- .andExpect (jsonPath ("$.patrons.length()" ).value (5 ));
57
+ .andExpect (jsonPath ("$.patrons.length()" ).value (4 ));
58
58
}
59
59
60
60
@ Test
@@ -139,14 +139,10 @@ void testController_deletesPatron() throws Exception {
139
139
}
140
140
141
141
UUID getGuestId (List <LibraryGuest > list ) {
142
- if (list .get (0 ).getCheckedOutMediaItems ().size () == 0 ) {
143
- return list .get (0 ).getId ();
144
- } else if (list .get (1 ).getCheckedOutMediaItems ().size () == 0 ) {
145
- return list .get (1 ).getId ();
146
- } else if (list .get (2 ).getCheckedOutMediaItems ().size () == 0 ) {
147
- return list .get (2 ).getId ();
148
- } else if (list .get (3 ).getCheckedOutMediaItems ().size () == 0 ) {
149
- return list .get (3 ).getId ();
142
+ for (LibraryGuest guest : list ) {
143
+ if (guest .getCheckedOutMediaItems ().size () == 0 ) {
144
+ return guest .getId ();
145
+ }
150
146
}
151
147
return list .get (4 ).getId ();
152
148
}
You can’t perform that action at this time.
0 commit comments