IntelliJ - live template 으로 tdd 만들기

여갱·2024년 4월 21일

Spring Boot

목록 보기
1/3

IntelliJ - Live template

우리가 코드를 칠 때 tdd 단축 명령어로 test 틀이 짜여지게 만들자. 단축 live template으로 만드는 방법을 알아보자.

Settings 단축키 : command + ,

Settings에서 live templates 검색해주고 Custom에 새로 이름 지어서 만들면된다. 그리고 Template text에 아래의 코드를 복붙해서

@Test
public void $Name$() throws Exception{
    //given
    $END$
    //when
    
    //then
}

Define 에서 java로 선택해주면된다.

업로드중..틀이 딱 만들어진다! live template으로 test틀을 쉽게 만들 수 있다.

0개의 댓글