mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
FIX: Pairs must not be modified by query (#1539)
* FIX: Pairs must not be modified by query * Modification can also occur on inValues. * fixed tests * removed obsolete line
This commit is contained in:
committed by
Rob Bygrave
parent
01d9dd3fe8
commit
105f08cca1
+9
-5
@@ -31,9 +31,9 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase {
|
||||
if (!loadOnce) {
|
||||
Ebean.find(OCachedNatKeyBean3.class).delete();
|
||||
|
||||
List<String> stores = new ArrayList<>(Arrays.asList("abc", "def"));
|
||||
List<String> stores =Arrays.asList("abc", "def");
|
||||
for (String store : stores) {
|
||||
List<String> skus = new ArrayList<>(Arrays.asList("1", "2", "3"));
|
||||
List<String> skus = Arrays.asList("1", "2", "3");
|
||||
for (String sku : skus) {
|
||||
int[] codes = {1000,1001,1002,1003,1004};
|
||||
for (int code : codes) {
|
||||
@@ -99,7 +99,7 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase {
|
||||
loadSomeIntoCache();
|
||||
|
||||
|
||||
List<Integer> codes = new ArrayList<>(Arrays.asList(1001, 1000, 1002, 1003));
|
||||
List<Integer> codes = Arrays.asList(1001, 1000, 1002, 1003);
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
@@ -132,7 +132,7 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase {
|
||||
setup();
|
||||
loadSomeIntoCache();
|
||||
|
||||
List<String> skus = new ArrayList<>(Arrays.asList("2", "3"));
|
||||
List<String> skus = Arrays.asList("2", "3");
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
@@ -162,7 +162,7 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase {
|
||||
loadSomeIntoCache();
|
||||
|
||||
String storeId = "abc";
|
||||
List<String> skus = new ArrayList<>(Arrays.asList("3", "2", "4"));
|
||||
List<String> skus = Arrays.asList("3", "2", "4");
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
@@ -272,6 +272,8 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase {
|
||||
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
|
||||
assertThat(pairs.getEntries()).hasSize(3);
|
||||
|
||||
assertThat(list).hasSize(3);
|
||||
assertNaturalKeyHitMiss(1, 2);
|
||||
assertBeanCacheHitMiss(1, 0);
|
||||
@@ -313,6 +315,8 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase {
|
||||
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
|
||||
assertThat(pairs.getEntries()).hasSize(3);
|
||||
|
||||
assertThat(list).hasSize(3);
|
||||
assertNaturalKeyHitMiss(1, 2);
|
||||
assertBeanCacheHitMiss(1, 0);
|
||||
|
||||
Reference in New Issue
Block a user