mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
Group By Null test
This commit is contained in:
parent
170dc10105
commit
c149a86a4c
@ -1,7 +1,7 @@
|
||||
package com.mysema.query.support;
|
||||
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@ -108,6 +108,18 @@ public class GroupBy2Test {
|
||||
assertEquals(Arrays.asList("comment 1", "comment 2", "comment 3"), group.getList(commentText));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Group_By_Null() {
|
||||
Map<Integer, Group2> results =
|
||||
GroupBy2.groupBy(postId).withOne(postName).withSet(commentId).withList(commentText).transform(BASIC_RESULTS);
|
||||
|
||||
Group2 group = results.get(null);
|
||||
assertNull(group.getOne(postId));
|
||||
assertEquals("null post", group.getOne(postName));
|
||||
assertEquals(toSet(7, 8), group.getSet(commentId));
|
||||
assertEquals(Arrays.asList("comment 7", "comment 8"), group.getList(commentText));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void With_Constant_Column() {
|
||||
Map<Integer, Group2> results =
|
||||
|
||||
Loading…
Reference in New Issue
Block a user