mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Adjust tests for JDK 18-ea build
This commit is contained in:
@@ -13,13 +13,12 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class TestLoadBeanCache extends BaseTestCase {
|
||||
class TestLoadBeanCache extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void testLoad() {
|
||||
void testLoad() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
@@ -35,32 +34,29 @@ public class TestLoadBeanCache extends BaseTestCase {
|
||||
// this will hit the cache
|
||||
Country nz = DB.find(Country.class, "NZ");
|
||||
|
||||
assertTrue(loadedNz == nz);
|
||||
assertSame(loadedNz, nz);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testLoadWithFindMap() {
|
||||
void testLoadWithFindMap() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
|
||||
List<Object> ids = DB.find(Customer.class).findIds();
|
||||
assertEquals(ids.size(), 4);
|
||||
assertThat(ids).isNotEmpty();
|
||||
|
||||
DB.getDefault().pluginApi().cacheManager().clearAll();
|
||||
|
||||
|
||||
// hit database
|
||||
LoggedSql.start();
|
||||
DB.find(Customer.class).where().idIn(ids).findMap();
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
|
||||
|
||||
// hit beanCache
|
||||
LoggedSql.start();
|
||||
DB.find(Customer.class).where().idIn(ids).findMap();
|
||||
sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user