mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
No effective change - add test for deploy parser
This commit is contained in:
@@ -2,6 +2,7 @@ package io.ebeaninternal.server.deploy;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.Address;
|
||||
import org.tests.model.basic.Customer;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -11,6 +12,8 @@ public class DeployPropertyParserTest extends BaseTestCase {
|
||||
|
||||
private final BeanDescriptor<Customer> descriptor = getBeanDescriptor(Customer.class);
|
||||
|
||||
private final BeanDescriptor<Address> addressBeanDescriptor = getBeanDescriptor(Address.class);
|
||||
|
||||
@Test
|
||||
public void from_prefix_expect_unchanged() {
|
||||
assertThat(parser().parse("(select x from status join status)")).isEqualTo("(select x from status join status)");
|
||||
@@ -31,6 +34,21 @@ public class DeployPropertyParserTest extends BaseTestCase {
|
||||
assertThat(parser().parse("max(billingAddress.country.name)")).isEqualTo("max(${billingAddress.country}name)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void simpleMax() {
|
||||
assertThat(parser().parse("max(name)")).isEqualTo("max(${}name)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void combined() {
|
||||
assertThat(parser().parse("sum(status * name)")).isEqualTo("sum(${}status * ${}name)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void combined_withAtColumn() {
|
||||
assertThat(adddressParser().parse("concat(line1, line2, '-EA')")).isEqualTo("concat(${}line_1, ${}line_2, '-EA')");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unknown_path() {
|
||||
assertThat(parser().parse(" foo ")).isEqualTo(" foo ");
|
||||
@@ -39,5 +57,9 @@ public class DeployPropertyParserTest extends BaseTestCase {
|
||||
private DeployPropertyParser parser() {
|
||||
return descriptor.createDeployPropertyParser();
|
||||
}
|
||||
|
||||
private DeployPropertyParser adddressParser() {
|
||||
return addressBeanDescriptor.createDeployPropertyParser();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user