Junit5 bump - ebean-querybean

This commit is contained in:
rbygrave
2021-09-06 18:05:11 +12:00
parent 43451c5342
commit eae8bbac82
10 changed files with 28 additions and 34 deletions
@@ -5,7 +5,7 @@ import org.example.domain.Customer;
import org.example.domain.Order;
import org.example.domain.OrderDetail;
import org.example.domain.Product;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.util.List;
@@ -1,7 +1,7 @@
package org.querytest;
import org.example.domain.query.QContact;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.time.ZonedDateTime;
@@ -1,7 +1,7 @@
package org.querytest;
import org.example.domain.Customer;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -4,10 +4,10 @@ import io.ebean.DB;
import io.ebean.Database;
import org.example.domain.Customer;
import org.example.domain.query.QCustomer;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
public class QCustomerByteArrayTest {
@Test
@@ -2,7 +2,7 @@ package org.querytest;
import org.example.domain.Customer;
import org.example.domain.query.QCustomer;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.util.Date;
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.QContact;
import org.example.domain.query.QCustomer;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import javax.sql.DataSource;
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.QContact.Alias.lastName;
import static org.example.domain.query.QCustomer.Alias.billingAddress;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public class QCustomerTest {
@Rule
public final TestName testName = new TestName();
@Test
public void findWithTransaction() {
@@ -213,8 +208,7 @@ public class QCustomerTest {
.findOne();
}
@Ignore
@Disabled
@Test
public void arrayContains() {
@@ -775,7 +769,7 @@ public class QCustomerTest {
public void testFindSet() {
Set<Customer> customerSet = new QCustomer().findSet();
Assert.assertNotNull(customerSet);
assertNotNull(customerSet);
}
@Test
@@ -831,11 +825,11 @@ public class QCustomerTest {
@Test
public void testFetchByScalarValue() {
Customer cust = new Customer();
cust.setName(testName.getMethodName());
cust.setName("testFetchByScalarValue");
cust.setPhoneNumber(new PhoneNumber("+18005555555"));
cust.save();
assertThat(new QCustomer()
.name.eq(testName.getMethodName())
.name.eq("testFetchByScalarValue")
.phoneNumber.eq(new PhoneNumber("+18005555555"))
.findOne()).isNotNull();
}
@@ -844,23 +838,23 @@ public class QCustomerTest {
@Test
public void testFetchByComparableScalarValue() {
Customer cust = new Customer();
cust.setName(testName.getMethodName());
cust.setName("testFetchByComparableScalarValue");
cust.setEmail(new ValidEmail("foo2@example.org"));
cust.save();
assertThat(new QCustomer()
.name.eq(testName.getMethodName())
.name.eq("testFetchByComparableScalarValue")
.email.eq(new ValidEmail("foo2@example.org"))
.findOne()).isNotNull();
assertThat(new QCustomer()
.name.eq(testName.getMethodName())
.name.eq("testFetchByComparableScalarValue")
.email.gt(new ValidEmail("foo2@example.org"))
.findOne()).isNull();
assertThat(new QCustomer()
.name.eq(testName.getMethodName())
.name.eq("testFetchByComparableScalarValue")
.email.gt(new ValidEmail("foo1@example.org"))
.findOne()).isNotNull();
assertThat(new QCustomer()
.name.eq(testName.getMethodName())
.name.eq("testFetchByComparableScalarValue")
.email.greaterOrEqualTo(new ValidEmail("foo2@example.org"))
.findOne()).isNotNull();
}
@@ -8,9 +8,9 @@ import org.example.domain.Order;
import org.example.domain.otherpackage.PhoneNumber;
import org.example.domain.query.QCustomer;
import org.example.domain.query.QOrder;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.util.List;
@@ -55,12 +55,12 @@ public class QOrderTest {
private static Order order;
private static Customer customer;
@BeforeClass
@BeforeAll
public static void before() {
setupData();
}
@AfterClass
@AfterAll
public static void after() {
DB.delete(order);
DB.delete(customer);
@@ -2,13 +2,13 @@ package org.querytest;
import org.example.domain.query.QAreaImpl;
import org.example.domain.query.QCityImpl;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class TargetTest {
@Test
public void test_oneToMany() {
new QAreaImpl()
.cities.fetch()
.findList();