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: 검증
마지막으로 테스트를 검증하는 단계
예상값과 테스트 결과값을 비교하여 검증한다.
테스트 코드를 작성하는 이유는?
의도대로 작동하는지 확인하기 위함이다.
동작 이해에 도움을 주기 때문이다.
software 품질을 향상하기 위함이다.
4.@SpringBootTest 가 하는 역할은?
SpringBoot 애플리케이션을 테스트하기 위한 애노테이션이다. 이 애노테이션은 애플리케이션 컨텍스트를 로드하고, 테스트 환경에서 애플리케이션을 실행하여 통합 테스트를 수행한다.
5.@test 가 하는 역할은?
JUnit 프레임 워크에서 테스트 메소드임을 나타내는 애노테이션이다. 이 애노테이션이 지정된 메소드는 JUnit 테스트 실행기에 의 실행되며, 해당 메소드가 예외를 던지거나 AssertionError를 발생시키면 해당 테스트는 실패로 처리된다.
6.mockito를 쓰는 이유는?
자바에서 모의 객체를 생성하고, 테스트할 때 사용하는 프레임워크이다. Mockito를 사용하면, 테스트 대상 객체의 의존성을 모의 객체로 대체하여, 테스트 환경에서 객체 간 상호작용을 쉽게 테스트할 수 있다.
7.assertAll 가 하는 역할은?
executable로 묶어서 사용하여 위에서 에러가 실패하더라도 한번에 묶인 테스트를 모두 실행할 수 있다.