| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Tags
- OS
- 쿠버네티스
- Kotlin
- 토비의 스프링
- redis
- 이스티오
- gradle
- 스트림
- 자바
- 보조스트림
- Java
- 자바 ORM 표준 JPA 프로그래밍
- mysql
- Collection
- K8s
- Stream
- 스프링
- thread
- JPA
- GC
- spring
- 토비의 스프링 정리
- MSA
- Stack
- jvm
- Real MySQL
- 백준
- list
- SpringBoot
- IntellJ
Archives
- Today
- Total
인생을 코딩하다.
Junit4 -> Junit5 (목적(쓰임새)은 같지만 4 -> 5 로직 비교) 본문
728x90
반응형
============ 기준으로 위 4, 아래 5
content().string(containsString()) // Junit4
====================================================================
content().string(org.hamcrest.Matchers.containsString()))) // Junit5
assertThat(skhu.getId(), is()); // import org.hamcrest.core.Is.is;
==================================================================================================
assertThat(skhu.getId()).isEqualTo(); // import static org.assertj.core.api.Assertions.assertThat;
@BeforeAll -> BeforeClass / @Before -> @BeforeEach
@Test(exampleNotFoundExcepiton.class) // Junit4
public void getExampleWithNotExisted() {
exampleSerivce.getExample(404L)
=======================================================================================
@test
public void getExampleWithNotExisted() { // Junit5
exampleService.getExample(404L);
assertThrow(ExampleNotFoundException.cass, () -> exampleService.getExample(404));
...작성중
728x90
반응형
'Spring' 카테고리의 다른 글
| [Spring] RestTemplate (0) | 2020.12.17 |
|---|---|
| [Spring] @CrossOrigin (0) | 2020.12.10 |
| [Spring] Spring이 왜 Spring인지? 와 SpringBoot VS Spring (0) | 2020.11.08 |
| [Spring] @ControllerAdvice -> @RestControllerAdvice (0) | 2020.10.31 |
| [Spring] Spring AOP를 이용한 메서드 시간측정 / @LogExecutionTime (2) | 2020.10.29 |
Comments