@@ -114,6 +114,7 @@ public void tearDown() throws Exception {
114114 ResultActions resultActions = mockMvc .perform (post ("/home/memos" )
115115 .with (csrf ())
116116 .sessionAttr ("user" , sessionUser )
117+ .secure (true )
117118 .contentType (MediaType .APPLICATION_JSON )
118119 .content (json ))
119120 .andExpect (status ().isOk ());
@@ -146,6 +147,7 @@ public void tearDown() throws Exception {
146147 // when, then
147148 mockMvc .perform (post ("/home/memos" )
148149 .with (csrf ())
150+ .secure (true )
149151 .contentType (MediaType .APPLICATION_JSON )
150152 .content (json ))
151153 .andExpect (status ().isUnauthorized ());
@@ -171,6 +173,7 @@ public void tearDown() throws Exception {
171173 mockMvc .perform (put ("/home/memos/{targetId}" , targetId )
172174 .with (csrf ())
173175 .sessionAttr ("user" , sessionUser )
176+ .secure (true )
174177 .contentType (MediaType .APPLICATION_JSON )
175178 .content (json ))
176179 .andExpect (status ().isOk ());
@@ -204,6 +207,7 @@ public void tearDown() throws Exception {
204207 mockMvc .perform (put ("/home/memos/{invalidId}" , invalidId )
205208 .with (csrf ())
206209 .sessionAttr ("user" , sessionUser )
210+ .secure (true )
207211 .contentType (MediaType .APPLICATION_JSON )
208212 .content (json ))
209213 .andExpect (status ().isNotFound ());
@@ -218,6 +222,7 @@ public void tearDown() throws Exception {
218222
219223 // when
220224 ResultActions resultActions = mockMvc .perform (get ("/home/memos" )
225+ .secure (true )
221226 .contentType (MediaType .APPLICATION_JSON ));
222227
223228 // then
@@ -237,6 +242,7 @@ public void tearDown() throws Exception {
237242
238243 // when
239244 ResultActions resultActions = mockMvc .perform (get ("/home/memos/{targetId}" , targetId )
245+ .secure (true )
240246 .sessionAttr ("user" , sessionUser ));
241247
242248 // then
@@ -254,7 +260,8 @@ public void tearDown() throws Exception {
254260 Long invalidId = publicMemo .getId ();
255261
256262 // when, then
257- mockMvc .perform (get ("/home/memos/{invalidId}" , invalidId ))
263+ mockMvc .perform (get ("/home/memos/{invalidId}" , invalidId )
264+ .secure (true ))
258265 .andExpect (status ().isNotFound ());
259266 }
260267
@@ -269,7 +276,8 @@ public void tearDown() throws Exception {
269276 // when
270277 mockMvc .perform (delete ("/home/memos/{targetId}" , targetId )
271278 .with (csrf ())
272- .sessionAttr ("user" , sessionUser ))
279+ .sessionAttr ("user" , sessionUser )
280+ .secure (true ))
273281 .andExpect (status ().isNoContent ());
274282
275283 // then
@@ -296,7 +304,8 @@ public void tearDown() throws Exception {
296304 // when, then
297305 mockMvc .perform (delete ("/home/memos/{memoId}" , memoId )
298306 .with (csrf ())
299- .sessionAttr ("user" , sessionUser ))
307+ .sessionAttr ("user" , sessionUser )
308+ .secure (true ))
300309 .andExpect (status ().isBadRequest ());
301310 }
302311
@@ -313,7 +322,8 @@ public void tearDown() throws Exception {
313322 // when, then
314323 mockMvc .perform (delete ("/home/memos/{invalidId}" , invalidId )
315324 .with (csrf ())
316- .sessionAttr ("user" , sessionUser ))
325+ .sessionAttr ("user" , sessionUser )
326+ .secure (true ))
317327 .andExpect (status ().isNotFound ());
318328 }
319329}
0 commit comments