() -> {}
간결한 코드 (함수형 인터페이스) 작성
하나의 추상 메소드를 가진 인터페이스
interface Drawable{
public void draw();
}
Drawable d= new Drawable(){
public void draw(){
System.out.println("Drawing "+width);
}
};
d.draw();
Drawable d2=()->{
System.out.println("Drawing "+width);
};
d2.draw();
= Junit Platform+ Junit Jupiter + Junit Vingate
package com.kit.dorm.member;
import org.junit.jupiter.api.*;
@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
class MemberTest {
@Test
void test_1(){
System.out.println("test1");
}
@Test
void test2(){
System.out.println("test2");
}
@BeforeAll
static void beforeAll(){
System.out.println("beforeAll");
}
@AfterAll
static void afterAll(){
System.out.println("afterAll");
}
@BeforeEach
void beforeEach(){
System.out.println("beforeEach");
}
@AfterEach
void afterEach(){
System.out.println("afterEach");
}
}
누구나 이해할 수 있는 Given, When, Then 구조
@Test
void simpleTest1(){
Member member1 = new Member(1L, "kim", 1);
Member member2 = new Member(1L, "kim", 1);
assertEquals(member1, member2);
}