Migrate to JUnit5

This commit is contained in:
Artur Mogozov
2017-12-31 16:29:48 +09:00
parent a20e54d0a7
commit 6694d742a3
408 changed files with 2656 additions and 2165 deletions

View File

@@ -32,8 +32,13 @@
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -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();
});
}
/**

View File

@@ -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}.