Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
명세란 무엇일까?
명세는 시스템, 제품 또는 서비스의 요구사항과 기능을 명확하게 정의하고 문서화하는 것을 말합니다.
단위테스트에서 Given / When / Then 에 대해 설명해주세요
Given / When / Then은 BDD (Behavior-Driven Development)에서 유래된 테스트 스타일로, 테스트 케이스를 구성하는데 사용됩니다.
Given: 테스트 실행을 위해 초기 상태를 설정하는 단계입니다. 주어진 조건을 설정하고 필요한 객체를 생성하거나 준비합니다.
When: 테스트하고자 하는 작업이 실행되는 단계입니다. 보통은 특정 메서드를 호출하거나 작업을 수행하는 단계입니다.
Then: 테스트 결과를 확인하는 단계입니다. 예상 결과와 실제 결과를 비교하고 검증합니다.
테스트 코드를 작성하는 이유는?
테스트 코드를 작성함으로써 코드의 동작을 검증하고, 변경 사항이나 기능 추가 등으로 인해 예상치 못한 오류가 발생하는 것을 방지할 수 있습니다.
@SpringBootTest 가 하는 역할은?
@SpringBootTest는 스프링 애플리케이션을 테스트하기 위한 애노테이션입니다.
애플리케이션 컨텍스트를 로드하고, 애플리케이션의 동작을 테스트할 수 있습니다.
@test 가 하는 역할은?
@test가 선언된 메서드는 JUnit에서 자동으로 실행되며, 해당 메서드가 테스트를 수행하도록 구현합니다.
mockito를 쓰는 이유는?
Mockito는 테스트에서 모의 객체(mock object)를 생성하고 사용할 수 있도록 해주는 프레임워크입니다.
모의 객체를 사용하면 실제 객체의 동작을 시뮬레이션하여 테스트 케이스를 작성할 수 있습니다.
assertAll 가 하는 역할은?
JUnit의 메서드로, 여러 개의 단언문을 한 번에 실행하고 모두 실패할 경우 한꺼번에 실패 정보를 보고하는 역할을 합니다.