Migrate to JUnit5
This commit is contained in:
@ -24,9 +24,11 @@
|
||||
|
||||
package com.iluwatar.retry;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link FindCustomer}.
|
||||
@ -50,9 +52,11 @@ public class FindCustomerTest {
|
||||
*
|
||||
* @throws Exception the expected exception
|
||||
*/
|
||||
@Test(expected = BusinessException.class)
|
||||
@Test
|
||||
public void oneException() throws Exception {
|
||||
new FindCustomer("123", new BusinessException("test")).perform();
|
||||
assertThrows(BusinessException.class, () -> {
|
||||
new FindCustomer("123", new BusinessException("test")).perform();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,10 +24,11 @@
|
||||
|
||||
package com.iluwatar.retry;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link Retry}.
|
||||
|
Reference in New Issue
Block a user