Junit5 bump - ebean-querybean

This commit is contained in:
rbygrave committed 2021-09-06 18:05:11 +12:00
1 parent 43451c5342
commit eae8bbac82
10 files changed
+27 -33

No files matched your search

+2 -2
View File
@@ -76,9 +76,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.avaje.composite</groupId> <groupId>io.avaje</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>1.1</version> <version>1.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -4,7 +4,7 @@ import io.ebeaninternal.server.expression.DefaultExpressionList;
import io.ebeaninternal.server.expression.SimpleExpression; import io.ebeaninternal.server.expression.SimpleExpression;
import org.example.domain.Customer; import org.example.domain.Customer;
import org.example.domain.query.QCustomer; import org.example.domain.query.QCustomer;
import org.junit.Test; import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@@ -5,7 +5,7 @@ import org.example.domain.Customer;
import org.example.domain.Order; import org.example.domain.Order;
import org.example.domain.OrderDetail; import org.example.domain.OrderDetail;
import org.example.domain.Product; import org.example.domain.Product;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.util.List; import java.util.List;
@@ -1,7 +1,7 @@
package org.querytest; package org.querytest;
import org.example.domain.query.QContact; import org.example.domain.query.QContact;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
@@ -1,7 +1,7 @@
package org.querytest; package org.querytest;
import org.example.domain.Customer; import org.example.domain.Customer;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@@ -4,10 +4,10 @@ import io.ebean.DB;
import io.ebean.Database; import io.ebean.Database;
import org.example.domain.Customer; import org.example.domain.Customer;
import org.example.domain.query.QCustomer; import org.example.domain.query.QCustomer;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.util.List; import java.util.List;
import static org.junit.Assert.*; import static org.junit.jupiter.api.Assertions.*;
public class QCustomerByteArrayTest { public class QCustomerByteArrayTest {
@Test @Test
@@ -2,7 +2,7 @@ package org.querytest;
import org.example.domain.Customer; import org.example.domain.Customer;
import org.example.domain.query.QCustomer; import org.example.domain.query.QCustomer;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -19,11 +19,8 @@ import org.example.domain.otherpackage.ValidEmail;
import org.example.domain.query.QAnimal; import org.example.domain.query.QAnimal;
import org.example.domain.query.QContact; import org.example.domain.query.QContact;
import org.example.domain.query.QCustomer; import org.example.domain.query.QCustomer;
import org.junit.Assert; import org.junit.jupiter.api.Disabled;
import org.junit.Ignore; import org.junit.jupiter.api.Test;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.sql.Connection; import java.sql.Connection;
@@ -46,12 +43,10 @@ import static org.example.domain.query.QAddress.Alias.country;
import static org.example.domain.query.QAddress.Alias.line1; import static org.example.domain.query.QAddress.Alias.line1;
import static org.example.domain.query.QContact.Alias.lastName; import static org.example.domain.query.QContact.Alias.lastName;
import static org.example.domain.query.QCustomer.Alias.billingAddress; import static org.example.domain.query.QCustomer.Alias.billingAddress;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public class QCustomerTest { public class QCustomerTest {
@Rule
public final TestName testName = new TestName();
@Test @Test
public void findWithTransaction() { public void findWithTransaction() {
@@ -213,8 +208,7 @@ public class QCustomerTest {
.findOne(); .findOne();
} }
@Disabled
@Ignore
@Test @Test
public void arrayContains() { public void arrayContains() {
@@ -775,7 +769,7 @@ public class QCustomerTest {
public void testFindSet() { public void testFindSet() {
Set<Customer> customerSet = new QCustomer().findSet(); Set<Customer> customerSet = new QCustomer().findSet();
Assert.assertNotNull(customerSet); assertNotNull(customerSet);
} }
@Test @Test
@@ -831,11 +825,11 @@ public class QCustomerTest {
@Test @Test
public void testFetchByScalarValue() { public void testFetchByScalarValue() {
Customer cust = new Customer(); Customer cust = new Customer();
cust.setName(testName.getMethodName()); cust.setName("testFetchByScalarValue");
cust.setPhoneNumber(new PhoneNumber("+18005555555")); cust.setPhoneNumber(new PhoneNumber("+18005555555"));
cust.save(); cust.save();
assertThat(new QCustomer() assertThat(new QCustomer()
.name.eq(testName.getMethodName()) .name.eq("testFetchByScalarValue")
.phoneNumber.eq(new PhoneNumber("+18005555555")) .phoneNumber.eq(new PhoneNumber("+18005555555"))
.findOne()).isNotNull(); .findOne()).isNotNull();
} }
@@ -844,23 +838,23 @@ public class QCustomerTest {
@Test @Test
public void testFetchByComparableScalarValue() { public void testFetchByComparableScalarValue() {
Customer cust = new Customer(); Customer cust = new Customer();
cust.setName(testName.getMethodName()); cust.setName("testFetchByComparableScalarValue");
cust.setEmail(new ValidEmail("foo2@example.org")); cust.setEmail(new ValidEmail("foo2@example.org"));
cust.save(); cust.save();
assertThat(new QCustomer() assertThat(new QCustomer()
.name.eq(testName.getMethodName()) .name.eq("testFetchByComparableScalarValue")
.email.eq(new ValidEmail("foo2@example.org")) .email.eq(new ValidEmail("foo2@example.org"))
.findOne()).isNotNull(); .findOne()).isNotNull();
assertThat(new QCustomer() assertThat(new QCustomer()
.name.eq(testName.getMethodName()) .name.eq("testFetchByComparableScalarValue")
.email.gt(new ValidEmail("foo2@example.org")) .email.gt(new ValidEmail("foo2@example.org"))
.findOne()).isNull(); .findOne()).isNull();
assertThat(new QCustomer() assertThat(new QCustomer()
.name.eq(testName.getMethodName()) .name.eq("testFetchByComparableScalarValue")
.email.gt(new ValidEmail("foo1@example.org")) .email.gt(new ValidEmail("foo1@example.org"))
.findOne()).isNotNull(); .findOne()).isNotNull();
assertThat(new QCustomer() assertThat(new QCustomer()
.name.eq(testName.getMethodName()) .name.eq("testFetchByComparableScalarValue")
.email.greaterOrEqualTo(new ValidEmail("foo2@example.org")) .email.greaterOrEqualTo(new ValidEmail("foo2@example.org"))
.findOne()).isNotNull(); .findOne()).isNotNull();
} }
@@ -8,9 +8,9 @@ import org.example.domain.Order;
import org.example.domain.otherpackage.PhoneNumber; import org.example.domain.otherpackage.PhoneNumber;
import org.example.domain.query.QCustomer; import org.example.domain.query.QCustomer;
import org.example.domain.query.QOrder; import org.example.domain.query.QOrder;
import org.junit.AfterClass; import org.junit.jupiter.api.AfterAll;
import org.junit.BeforeClass; import org.junit.jupiter.api.BeforeAll;
import org.junit.Test; import org.junit.jupiter.api.Test;
import java.util.List; import java.util.List;
@@ -55,12 +55,12 @@ public class QOrderTest {
private static Order order; private static Order order;
private static Customer customer; private static Customer customer;
@BeforeClass @BeforeAll
public static void before() { public static void before() {
setupData(); setupData();
} }
@AfterClass @AfterAll
public static void after() { public static void after() {
DB.delete(order); DB.delete(order);
DB.delete(customer); DB.delete(customer);
@@ -2,7 +2,7 @@ package org.querytest;
import org.example.domain.query.QAreaImpl; import org.example.domain.query.QAreaImpl;
import org.example.domain.query.QCityImpl; import org.example.domain.query.QCityImpl;
import org.junit.Test; import org.junit.jupiter.api.Test;
public class TargetTest { public class TargetTest {