Refactor move tests from ebean-core to ebean-test

This commit is contained in:
rbygrave
2021-09-08 22:49:23 +12:00
parent 0b00a14fd3
commit eab56d323b
1650 changed files with 185 additions and 147 deletions
@@ -0,0 +1,55 @@
package org.tests.basic;
import io.ebean.BaseTestCase;
import io.ebean.DB;
import org.tests.model.basic.TMapSuperEntity;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public class TestDeletePartialNoVersion extends BaseTestCase {
@Test
public void testNoVersion() {
TMapSuperEntity e = new TMapSuperEntity();
e.setName("babanaone");
DB.save(e);
// select includes a transient property
TMapSuperEntity e2 = DB.find(TMapSuperEntity.class)
.where().idEq(e.getId())
.select("id, name")
.findOne();
assertNotNull(e2);
e2.setName("banaban2");
DB.save(e2);
DB.delete(e2);
}
public void testWithVersion() {
TMapSuperEntity e = new TMapSuperEntity();
e.setName("babanatwo");
DB.save(e);
// select includes a transient property
TMapSuperEntity e2 = DB.find(TMapSuperEntity.class)
.where().idEq(e.getId())
.select("id, name, version")
.findOne();
assertNotNull(e2);
e2.setName("banaban2two");
DB.save(e2);
DB.delete(e2);
}
}