No effective change - extra tests for DeployPropertyParser

This commit is contained in:
Rob Bygrave committed 2018-02-13 14:09:08 +13:00
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();
}
}