junit4
@Test(expected=dataNotFoundClass)
public void notExisted()
{
dataService.getdata(키값)
}
junit 5
@Test
public void notExisted()
{
assertThrows(dataNotFoundClass.class,()->dataService.getdata(키값));
}
음 뭔가 junit5 직관적이진 않네요 ㅎ
'웹 > Spring' 카테고리의 다른 글
junit5 >> MockitoAnnotations.initMocks 사용법 (0) | 2022.08.17 |
---|---|
httpie '<' 연산자는 나중에 사용하도록 예약되어 있습니다. (0) | 2022.08.16 |
webPack vue spring으로 빌드하는 방법 (0) | 2022.07.26 |
@Before 실행 안될때 (0) | 2022.07.12 |
spring 어노테이션01 (0) | 2022.07.09 |