ajeong

  • 홈
  • 태그
  • 방명록

Spring/Test 1

[Spring Test] 파일 업로드 컨트롤러 테스트 (File + Text)

✨ 기존 - 기존 컨트롤러 테스트에서는 get or post 방식의 request를 생성하기 위해 MockMvcResultBuilders의 get(), post() 메서드를 이용하였다. String body = objectMapper.writeValueAsString(dto); ResultActions perform = mockMvc.perform(post("/boards") .contentType(MediaType.APPLICATION_JSON) .locale(Locale.KOREA) .content(body)); // ControllerTest perform.andDo(print()) .andExpect(status().isBadRequest()) .andExpect(content().contentT..

Spring/Test 2024.03.03
이전
1
다음
더보기
프로필사진

와자잣 ٩(•̤̀ᵕ•̤́๑)૭✧ https://ajung7038.github.io/

  • 분류 전체보기 (44)
    • Spring (19)
      • MSA (7)
      • JPA (8)
      • MVC (1)
      • Test (1)
    • FE (11)
      • HTML & CSS (3)
      • React (8)
    • Algorithm (12)
      • 개념 & 문법 (10)
      • BOJ (2)
    • Tool (2)

Archives

방문자수Total

  • Today :
  • Yesterday :
git Velog

Copyright © Kakao Corp. All rights reserved.

  • git

티스토리툴바