File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/test/java/com/back/domain/mybar/controller Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -220,4 +220,22 @@ void unkeepCocktail() throws Exception {
220220
221221 verify (myBarService ).unkeep (principal .getId (), cocktailId );
222222 }
223+
224+ @ Test
225+ @ DisplayName ("Clear entire my bar" )
226+ void clearAllMyBar () throws Exception {
227+ SecurityUser principal = createPrincipal (21L );
228+
229+ willDoNothing ().given (myBarService ).clearAll (principal .getId ());
230+
231+ mockMvc .perform (delete ("/me/bar" )
232+ .with (withPrincipal (principal ))
233+ .accept (MediaType .APPLICATION_JSON ))
234+ .andExpect (status ().isOk ())
235+ .andExpect (jsonPath ("$.code" ).value (200 ))
236+ .andExpect (jsonPath ("$.message" ).value ("cleared" ))
237+ .andExpect (jsonPath ("$.data" ).doesNotExist ());
238+
239+ verify (myBarService ).clearAll (principal .getId ());
240+ }
223241}
You can’t perform that action at this time.
0 commit comments