mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-06 00:32:18 +00:00
#710 - Behavior change - query with invalid fetch path (without properties) now throws PersistenceException
This commit is contained in:
1 parent
362ceea79b
commit
75a2633590
4 files changed
+33
-12
No files matched your search
@@ -5,15 +5,31 @@ import com.avaje.ebean.Ebean;
|
||||
import com.avaje.tests.model.basic.Customer;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
public class TestInvalidFetchPath extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void testWithPathAndProperties() {
|
||||
@Test(expected = PersistenceException.class)
|
||||
public void invalidFetchPathAndProperties_expect_error() {
|
||||
|
||||
Ebean.find(Customer.class)
|
||||
.fetch("notHaveProps", "notHaveProps")
|
||||
.fetch("notValidPath", "notHaveProps")
|
||||
.findList();
|
||||
|
||||
}
|
||||
|
||||
@Test(expected = PersistenceException.class)
|
||||
public void invalidFetchPath_expect_error() {
|
||||
|
||||
Ebean.find(Customer.class)
|
||||
.fetch("notValidPath")
|
||||
.findList();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fetchWithInvalidPropertyName_expect_allowed() {
|
||||
|
||||
Ebean.find(Customer.class)
|
||||
.fetch("billingAddress", "invalidPropertyName")
|
||||
.findList();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user