No effective change - update test for TestTransientMap

This commit is contained in:
rob bygrave
2019-07-17 13:48:12 +12:00
parent f31ab4d6a8
commit 0663a97941
2 changed files with 25 additions and 7 deletions
@@ -10,12 +10,16 @@ import java.util.Map;
public class BSimpleWithGen {
@Id
Integer id;
private Integer id;
String name;
private String name;
@Transient
Map<String, List<String>> someMap;
private Map<String, List<String>> someMap;
public BSimpleWithGen(String name) {
this.name = name;
}
public Integer getId() {
return id;
@@ -1,18 +1,32 @@
package org.tests.basic.type;
import io.ebean.BaseTestCase;
import io.ebean.Ebean;
import io.ebean.DB;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
public class TestTransientMap extends BaseTestCase {
@Test
public void testMe() {
BSimpleWithGen b = new BSimpleWithGen();
b.setName("blah");
Map<String, List<String>> map = new HashMap<>();
map.put("foo", new ArrayList<>());
Ebean.save(b);
BSimpleWithGen b = new BSimpleWithGen("blah");
b.setSomeMap(map);
DB.save(b);
final BSimpleWithGen found = DB.find(BSimpleWithGen.class, b.getId());
assertThat(found.getName()).isEqualTo("blah");
assertThat(found.getSomeMap()).isNull();
DB.delete(b);
}
}