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

@ -22,21 +22,20 @@
*/
package com.iluwatar.cqrs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.math.BigInteger;
import java.util.List;
import org.junit.BeforeClass;
import org.junit.Test;
import com.iluwatar.cqrs.commandes.CommandServiceImpl;
import com.iluwatar.cqrs.commandes.ICommandService;
import com.iluwatar.cqrs.dto.Author;
import com.iluwatar.cqrs.dto.Book;
import com.iluwatar.cqrs.queries.IQueryService;
import com.iluwatar.cqrs.queries.QueryServiceImpl;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Integration test of IQueryService and ICommandService with h2 data
@ -47,14 +46,11 @@ public class IntegrationTest {
private static IQueryService queryService;
private static ICommandService commandService;
@BeforeClass
public static void initialize() {
@BeforeAll
public static void initializeAndPopulateDatabase() {
commandService = new CommandServiceImpl();
queryService = new QueryServiceImpl();
}
@BeforeClass
public static void populateDatabase() {
// create first author1
commandService.authorCreated("username1", "name1", "email1");
@ -94,7 +90,7 @@ public class IntegrationTest {
public void testGetBook() {
Book book = queryService.getBook("title1");
assertEquals("title1", book.getTitle());
assertEquals(10, book.getPrice(), 0);
assertEquals(10, book.getPrice(), 0.01);
}
@Test