λ°μν
Notice
Recent Posts
Recent Comments
Link
μΌ | μ | ν | μ | λͺ© | κΈ | ν |
---|---|---|---|---|---|---|
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 | 29 | 30 |
Tags
- SSE
- ChatGPT
- 리μ‘νΈ
- λͺ¨λ°μΌμ±νλ‘κ·Έλλ°
- κ°λ°μ
- 그리λ
- spring
- 컴곡
- 그리λμκ³ λ¦¬μ¦
- μ»΄ν¨ν°κ³΅ν
- μ½λ©
- μκ³ λ¦¬μ¦
- μλ£κ΅¬μ‘°
- λ°±μ€νμ΄
- λ¨μν μ€νΈ
- 리μ‘νΈλ€μ΄ν°λΈ
- μ΄νκ³μ
- μΉκ°λ°κΈ°λ‘
- μ°μ μμν
- λ°±μλ
- νλ‘ νΈμ€λ
- νμ΄μ¬
- 컴곡μ
- μΉκ°λ°
- boj11653
- μ½λ©ν μ€νΈ
- νλ‘κ·Έλλ°
- λ°±μ€
- μ€νλ§
- λ°±μ€1436
Archives
- Today
- Total
π»ππ§π
[Spring] Test Case μμ± λ³Έλ¬Έ
λ°μν
@Test
public void save(){
Member member = new Member();
member.setName("Spring");
repository.save(member);
Member result = repository.findById(member.getId()).get();
Assertions.assertThat(member).isEqualTo(result);
}
- Test λ©μλ μμλ
@Test
μ΄λ Έν μ΄μ νκΈ°
Assertions
- λ΄κ° κ°μ νκ³ μλ μ¬μ€μ΄ μ€μ μ κ°μμ§ λͺ μν μ μλ λꡬ
Assertion.assertThat(expected,actual)
β‘οΈ JUnit λ©μλλ‘, expected μ actual κ° κ°μμ§ λΉκ΅
β
μμ μ μν΄μΌ ν¨ !!!!
Assertion.assertThat(actual).isEqualTo(expected)
β‘οΈ AssertJ λ©μλλ‘, λ§μ°¬κ°μ§λ‘ expected μ actualμ΄ κ°μμ§ λΉκ΅
( μ€μ κ° μ΄ λ΄κ° μκ°ν μμκ° κ³Ό κ°μκ°? β‘οΈ μ΄ μμλ‘ λ³μ μ λ ₯)
β ν μ€νΈ ν΄λμ€λ₯Ό μ 체 μ€νν λ, λ©μλκ° λ΄κ° μμ±ν μμλλ‘ λμκ°λ κ²μ΄ μλ!!!
@AfterEach
public void afterEach(){
repository.clearStore();
}
β‘οΈ@AfterEach
μ΄λ
Έν
μ΄μ
μ λΆμ¬μ κ° λ©μλκ° μ€νλκ³ λ ν λ°λ‘ μ€νλ λ©μλλ₯Ό μμ±ν΄μ μ€λ₯ ν΄κ²°!
λ°μν
'Backend Spring' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
Repository μ½λ μμ± μ€Java λ¬Έλ² μ 리 (0) | 2023.12.19 |
---|