mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#507 - PropertiesWrapper support null enum values with getEnum()
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.avaje.ebean.config;
|
||||
|
||||
import com.avaje.ebean.config.dbplatform.DbPlatformName;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Properties;
|
||||
@@ -17,6 +18,18 @@ public class PropertiesWrapperTest {
|
||||
assertEquals("myserver", pw.getServerName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetEnum() {
|
||||
|
||||
Properties properties = new Properties();
|
||||
properties.put("platform","postgres");
|
||||
|
||||
PropertiesWrapper pw = new PropertiesWrapper("pref", "myserver", properties);
|
||||
assertEquals(DbPlatformName.POSTGRES, pw.getEnum(DbPlatformName.class, "platform", DbPlatformName.H2));
|
||||
assertEquals(DbPlatformName.H2, pw.getEnum(DbPlatformName.class, "junk", DbPlatformName.H2));
|
||||
assertNull(pw.getEnum(DbPlatformName.class, "junk", null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTrimPropertyValues() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user