@@ -135,26 +135,26 @@ public void testFindStrings_wrongPropertyType() {
135135 public void testFindString () {
136136 Query <TestEntity > query = box .query ().greater (simpleLong , 1002 ).build ();
137137 PropertyQuery propertyQuery = query .property (simpleString );
138- assertNull (propertyQuery .findFirstString ());
139- assertNull (propertyQuery .reset ().findUniqueString ());
138+ assertNull (propertyQuery .findString ());
139+ assertNull (propertyQuery .reset ().unique (). findString ());
140140 putTestEntities (5 );
141- assertEquals ("foo3" , propertyQuery .reset ().findFirstString ());
141+ assertEquals ("foo3" , propertyQuery .reset ().findString ());
142142
143143 query = box .query ().greater (simpleLong , 1004 ).build ();
144144 propertyQuery = query .property (simpleString );
145- assertEquals ("foo5" , propertyQuery .reset ().findUniqueString ());
145+ assertEquals ("foo5" , propertyQuery .reset ().unique (). findString ());
146146
147147 putTestEntity (null , 6 );
148148 // TODO XXX enable me after fixing combination of unique and distinct: putTestEntity(null, 7);
149149 query .setParameter (simpleLong , 1005 );
150- assertEquals ("nope" , propertyQuery .reset ().distinct ().nullValue ("nope" ).findUniqueString ());
150+ assertEquals ("nope" , propertyQuery .reset ().distinct ().nullValue ("nope" ).unique (). findString ());
151151 }
152152
153153 @ Test (expected = DbException .class )
154154 public void testFindString_uniqueFails () {
155155 putTestEntity ("foo" , 1 );
156156 putTestEntity ("foo" , 2 );
157- box .query ().build ().property (simpleString ).findUniqueString ();
157+ box .query ().build ().property (simpleString ).unique (). findString ();
158158 }
159159
160160 @ Test
@@ -177,32 +177,32 @@ public void testFindLongs() {
177177 @ Test
178178 public void testFindLong () {
179179 Query <TestEntity > query = box .query ().greater (simpleLong , 1002 ).build ();
180- assertNull (query .property (simpleLong ).findFirstLong ());
181- assertNull (query .property (simpleLong ).findUniqueLong ());
180+ assertNull (query .property (simpleLong ).findLong ());
181+ assertNull (query .property (simpleLong ).findLong ());
182182 putTestEntities (5 );
183- assertEquals (1003 , (long ) query .property (simpleLong ).findFirstLong ());
183+ assertEquals (1003 , (long ) query .property (simpleLong ).findLong ());
184184
185185 query = box .query ().greater (simpleLong , 1004 ).build ();
186- assertEquals (1005 , (long ) query .property (simpleLong ).distinct ().findUniqueLong ());
186+ assertEquals (1005 , (long ) query .property (simpleLong ).distinct ().findLong ());
187187 }
188188
189189 @ Test (expected = DbException .class )
190190 public void testFindLong_uniqueFails () {
191191 putTestEntity (null , 1 );
192192 putTestEntity (null , 1 );
193- box .query ().build ().property (simpleLong ).findUniqueLong ();
193+ box .query ().build ().property (simpleLong ).unique (). findLong ();
194194 }
195195
196196 @ Test
197197 public void testFindInt () {
198198 Query <TestEntity > query = box .query ().greater (simpleLong , 1002 ).build ();
199- assertNull (query .property (simpleInt ).findFirstInt ());
200- assertNull (query .property (simpleInt ).findUniqueInt ());
199+ assertNull (query .property (simpleInt ).findInt ());
200+ assertNull (query .property (simpleInt ).unique (). findInt ());
201201 putTestEntities (5 );
202- assertEquals (3 , (int ) query .property (simpleInt ).findFirstInt ());
202+ assertEquals (3 , (int ) query .property (simpleInt ).findInt ());
203203
204204 query = box .query ().greater (simpleLong , 1004 ).build ();
205- assertEquals (5 , (int ) query .property (simpleInt ).distinct ().findUniqueInt ());
205+ assertEquals (5 , (int ) query .property (simpleInt ).distinct ().unique (). findInt ());
206206
207207 TestEntityCursor .INT_NULL_HACK = true ;
208208 try {
@@ -211,26 +211,26 @@ public void testFindInt() {
211211 TestEntityCursor .INT_NULL_HACK = false ;
212212 }
213213 query .setParameter (simpleLong , 1005 );
214- assertEquals (-99 , (int ) query .property (simpleInt ).nullValue (-99 ).findUniqueInt ());
214+ assertEquals (-99 , (int ) query .property (simpleInt ).nullValue (-99 ).unique (). findInt ());
215215 }
216216
217217 @ Test (expected = DbException .class )
218218 public void testFindInt_uniqueFails () {
219219 putTestEntity (null , 1 );
220220 putTestEntity (null , 1 );
221- box .query ().build ().property (simpleInt ).findUniqueInt ();
221+ box .query ().build ().property (simpleInt ).unique (). findInt ();
222222 }
223223
224224 @ Test
225225 public void testFindDouble () {
226226 Query <TestEntity > query = box .query ().greater (simpleLong , 1002 ).build ();
227- assertNull (query .property (simpleDouble ).findFirstDouble ());
228- assertNull (query .property (simpleDouble ).findUniqueDouble ());
227+ assertNull (query .property (simpleDouble ).findDouble ());
228+ assertNull (query .property (simpleDouble ).unique (). findDouble ());
229229 putTestEntities (5 );
230- assertEquals (2000.03 , query .property (simpleDouble ).findFirstDouble (), 0.001 );
230+ assertEquals (2000.03 , query .property (simpleDouble ).findDouble (), 0.001 );
231231
232232 query = box .query ().greater (simpleLong , 1004 ).build ();
233- assertEquals (2000.05 , query .property (simpleDouble ).distinct ().findUniqueDouble (), 0.001 );
233+ assertEquals (2000.05 , query .property (simpleDouble ).distinct ().unique (). findDouble (), 0.001 );
234234 }
235235
236236 // TODO add test for other types of single object find methods
0 commit comments