mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-12-01 15:37:14 +00:00
No effective change - extra tests for DeployPropertyParser
This commit is contained in:
1 parent
f1b2a09b30
commit
17a54e3804
1 file changed
+38
@@ -0,0 +1,38 @@
|
|||||||
|
package io.ebeaninternal.server.deploy;
|
||||||
|
|
||||||
|
import io.ebean.BaseTestCase;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.tests.model.basic.Customer;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
|
||||||
|
public class DeployPropertyParserTest extends BaseTestCase {
|
||||||
|
|
||||||
|
private final BeanDescriptor<Customer> descriptor = getBeanDescriptor(Customer.class);
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void depth0_path() {
|
||||||
|
assertThat(parser().parse("pre status post")).isEqualTo("pre ${}status post");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void depth1_path() {
|
||||||
|
assertThat(parser().parse("billingAddress.city")).isEqualTo("${billingAddress}city");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void depth2_path() {
|
||||||
|
assertThat(parser().parse("max(billingAddress.country.name)")).isEqualTo("max(${billingAddress.country}name)");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void unknown_path() {
|
||||||
|
assertThat(parser().parse(" foo ")).isEqualTo(" foo ");
|
||||||
|
}
|
||||||
|
|
||||||
|
private DeployPropertyParser parser() {
|
||||||
|
return descriptor.createDeployPropertyParser();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in new issue
Block a user