File tree Expand file tree Collapse file tree
querydsl-tooling/querydsl-apt/src/test/java/com/querydsl/apt/domain Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .querydsl .apt .domain ;
2+
3+ import static org .junit .Assert .assertEquals ;
4+ import static org .junit .Assert .assertNotNull ;
5+
6+ import com .querydsl .core .types .dsl .Expressions ;
7+ import org .junit .Test ;
8+
9+ public class QueryProjectionBuilderTest {
10+
11+ @ Test
12+ public void builder_buildsQClassCorrectly () {
13+ var property = Expressions .stringPath ("x" );
14+ QQueryProjectionBuilderTestEntity dto =
15+ QQueryProjectionBuilderTestEntity .builderTest1 ().setProperty (property ).build ();
16+
17+ assertNotNull (dto );
18+ assertEquals (QueryProjectionBuilderTestEntity .class , dto .getType ());
19+ }
20+
21+ @ Test
22+ public void builder_buildsQClassCorrectly2 () {
23+ var property = Expressions .stringPath ("x" );
24+ var intProperty = Expressions .numberPath (Integer .class , "y" );
25+ QQueryProjectionBuilderTestEntity dto =
26+ QQueryProjectionBuilderTestEntity .builderTest2 ()
27+ .setProperty (property )
28+ .setIntProperty (intProperty )
29+ .build ();
30+
31+ assertNotNull (dto );
32+ assertEquals (QueryProjectionBuilderTestEntity .class , dto .getType ());
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments