File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/test/java/hexlet/code/controller/api Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -127,17 +127,19 @@ void create() throws Exception {
127127
128128 @ Test
129129 void update () throws Exception {
130+ var userId = testUser .getId ();
131+
130132 var data = new HashMap <>();
131133 data .put ("firstName" , "Mike" );
132134
133- var request = put (urlId , testUser . getId () )
135+ var request = put (urlId , userId )
134136 .with (token )
135137 .contentType (MediaType .APPLICATION_JSON )
136138 .content (om .writeValueAsString (data ));
137139
138140 mvc .perform (request ).andExpect (status ().isOk ());
139141
140- var user = userRepository .findById (testUser . getId () ).orElseThrow ();
142+ var user = userRepository .findById (userId ).orElseThrow ();
141143
142144 assertThat (user .getFirstName ()).isEqualTo (("Mike" ));
143145 }
You can’t perform that action at this time.
0 commit comments