You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@SpringBootTest
public class ParentRedisTests {
@Autowired
ParentRedisRepository parentRedisRepository;
@Test
void fetchParentByChildId(){
Child child1 = new Child(1L, "childValue1");
Child child2 = new Child(2L, "childValue2");
Parent parent1 = new Parent(1L, "parentValue1", child2);
Parent parent2 = new Parent(2L, "parentValue2", child1);
Parent parent3 = new Parent(3L, "parentValue3", child1);
Parent parent4 = new Parent(4L, "parentValue4", child1);
List<Parent> assertionList = List.of(parent2, parent3, parent4);
parentRedisRepository.saveAll(List.of(parent1, parent2, parent3, parent4));
List<Parent> parentList = parentRedisRepository.findByChildId("1");
assertThat(parentList).containsAnyElementsOf(assertionList); //PASSED in v3.2.3 and FAILED in v3.2.4
}
}
This repository call used to work till Spring Data Redis v3.2.3, but when I switched to 3.2.4, it did not work as per my requirements. When I monitored the REDIS commands, the following was noticed when I tried to hit the function to fetch by Child ID value 1:
In V3.2.4, the test ran the following command(s):
HGETALL Parent:1
In V3.2.3, the test ran the following command(s):
SINTER Parent:Child.id:1
HGETALL Parent:2
HGETALL Parent:3
HGETALL Parent:4
The text was updated successfully, but these errors were encountered:
Class A:
Class B:
Class A Repository:
Test Class:
This repository call used to work till Spring Data Redis v3.2.3, but when I switched to 3.2.4, it did not work as per my requirements. When I monitored the REDIS commands, the following was noticed when I tried to hit the function to fetch by Child ID value 1:
In V3.2.4, the test ran the following command(s):
In V3.2.3, the test ran the following command(s):
The text was updated successfully, but these errors were encountered: