junit4

@Test(expected=dataNotFoundClass)
public void notExisted()
{
    dataService.getdata(키값)
}

junit 5

 @Test
public void notExisted()
{
      assertThrows(dataNotFoundClass.class,()->dataService.getdata(키값));
}

 

음 뭔가 junit5 직관적이진 않네요 ㅎ 

+ Recent posts