티스토리 뷰
Spring/Spring Test
Spring Test : Spring Boot 2.1 이전 버전에서의 Junit 5 설정하기
Korean Eagle 2020. 8. 2. 23:36728x90
1. 현재 스프링 최신버전은 2.3.2이다. 현재 버전에서는 아래처럼 기본적으로 JUnit 5만 import된다.
1-1 exclusions 부분이 있어 vintage를 걷어내도록 하고 있는데 exclusions이 부분을 삭제하면 JUnit 4가 import 된다.
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
2. 버전이 2.1 이전의 경우 JUnit 5를 사용하기 위해서는 기존의 JUnit 4을 제거하고 JUnit 5를 삽입하는 부분이 필요하다.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>2.22.0</version>
<scope>test</scope>
</dependency>
</dependencies>
728x90
'Spring > Spring Test' 카테고리의 다른 글
Spring Test : Integration Test (0) | 2020.08.04 |
---|---|
Spring Test : JUnit 5 Mockito Unit Test (0) | 2020.08.03 |
Spring Test : Maven Integration Test 설정하기 (0) | 2020.08.01 |
Spring Test : Repository Integration Test with @RunWith, @DataJpaTest (0) | 2020.07.31 |
Spring Test : MockMvc 사용하여 MVC Controller 테스트 하기 (0) | 2020.07.31 |
댓글
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
- 도커 개발환경 참고
- AWS ARN 구조
- Immuability에 관한 설명
- 자바스크립트 멀티 비동기 함수 호출 참고
- WSDL 참고
- SOAP 컨슈머 참고
- MySql dump 사용법
- AWS Lambda with Addon
- NFC 드라이버 linux 설치
- electron IPC
- mifare classic 강의
- go module 관련 상세한 정보
- C 메모리 찍어보기
- C++ Addon 마이그레이션
- JAX WS Header 관련 stackoverflow
- SOAP Custom Header 설정 참고
- SOAP Custom Header
- SOAP BindingProvider
- dispatcher 사용하여 설정
- vagrant kvm으로 사용하기
- git fork, pull request to the …
- vagrant libvirt bridge network
- python, js의 async, await의 차이
- go JSON struct 생성
- Netflix Kinesis 활용 분석
- docker credential problem
- private subnet에서 outbound IP 확…
- 안드로이드 coroutine
- kotlin with, apply, also 등
- 안드로이드 초기로딩이 안되는 경우
- navigation 데이터 보내기
- 레이스 컨디션 navController
- raylib
TAG
- one-to-many
- RestTemplate
- 매핑
- 외부파일
- 설정
- MYSQL
- Validation
- 자바
- login
- hibernate
- Spring Security
- jsp
- Security
- WebMvc
- 스프링
- 설정하기
- 상속
- mapping
- crud
- 하이버네이트
- spring boot
- 로그인
- Spring
- one-to-one
- form
- Many-To-Many
- Angular
- 스프링부트
- XML
- Rest
250x250