Skip to content

refactor: 유닛테스트를 BDDMockito로 포팅 - #19

Merged
kobenlys merged 1 commit into
developfrom
refactor/bddmockito-migration
Sep 3, 2026
Merged

kobenlys merged 1 commit into
developfrom
refactor/bddmockito-migration

Conversation

@kobenlys

@kobenlys kobenlys commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🏷️ 작업 유형

  • 🐛 버그 픽스
  • ✨ 개발
  • 📝 문서 추가 및 수정
  • ♻️ 리팩터링
  • 🔧 ETC

📋 변경 사항

  • 유닛테스트 16개 파일을 classic Mockito에서 BDDMockito로 전환
  • // given 블록 안에 when(이 오던 단어 충돌 제거 — 주석과 코드가 같은 단어를 쓰도록 통일
classic BDD
when().thenReturn() given().willReturn()
when().thenThrow() given().willThrow()
doThrow().when() willThrow().given()
verify() then().should()
verify(m, never()) then(m).should(never())
verifyNoInteractions() then().shouldHaveNoInteractions()
order.verify() then().should(order)
  • lenient().when()과 order.verifyNoMoreInteractions()는 BDDMockito에 대응 API가 없어 classic 유지
  • 동작 변경 없음. 스타일 통일만 수행

✅ 테스트

  • ./mvnw test — 476건 통과, 실패 0
  • 전환 전후 테스트 수·결과 동일

// given 블록 안에 when( 이 와서 같은 단어가 반대 뜻으로 쓰이는 충돌을
없애기 위해 classic Mockito 를 BDDMockito 로 전환한다.
16개 파일, 동작 변경 없음 (476개 통과 유지).

- when().thenReturn()     -> given().willReturn()
- when().thenThrow()      -> given().willThrow()
- doThrow().when()        -> willThrow().given()
- verify()                -> then().should()
- verify(m, never())      -> then(m).should(never())
- verifyNoInteractions()  -> then().shouldHaveNoInteractions()
- order.verify()          -> then().should(order)

lenient().when() 과 order.verifyNoMoreInteractions() 는 BDDMockito 에
대응 API 가 없어 classic 을 유지한다.
@kobenlys kobenlys self-assigned this Sep 3, 2026
@kobenlys
kobenlys merged commit 5c31c2d into develop Sep 3, 2026
2 checks passed
@kobenlys
kobenlys deleted the refactor/bddmockito-migration branch September 3, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant