diff --git a/src/test/java/io/tarantool/driver/integration/proxy/options/ProxySpaceSelectOptionsIT.java b/src/test/java/io/tarantool/driver/integration/proxy/options/ProxySpaceSelectOptionsIT.java index 8c023dd7..d791d53c 100644 --- a/src/test/java/io/tarantool/driver/integration/proxy/options/ProxySpaceSelectOptionsIT.java +++ b/src/test/java/io/tarantool/driver/integration/proxy/options/ProxySpaceSelectOptionsIT.java @@ -174,4 +174,38 @@ public void withModeTest() throws ExecutionException, InterruptedException { crudSelectOpts = client.eval("return crud_select_opts").get(); assertEquals(Mode.WRITE.value(), ((HashMap) crudSelectOpts.get(0)).get("mode")); } + + @Test + public void withAfterTest() { + TarantoolSpaceOperations> profileSpace = + client.space(TEST_SPACE_NAME); + + TarantoolResult emptyResult = profileSpace.select(Conditions.any()).join(); + assertEquals(0, emptyResult.size()); + + TarantoolTuple tuple; + TarantoolTuple insertedTuple; + final int tupleCount = 100; + for (int i = 0; i < tupleCount; i++) { + tuple = tupleFactory.create(i, null, String.valueOf(i), i); + insertedTuple = profileSpace.insert(tuple).join().get(0); + assertEquals(insertedTuple.getObject(0), tuple.getObject(0)); + assertEquals(insertedTuple.getObject(2), tuple.getObject(2)); + assertEquals(insertedTuple.getObject(3), tuple.getObject(3)); + assertEquals(insertedTuple.getObject(4), tuple.getObject(4)); + } + + TarantoolResult resultAfterInsert = profileSpace.select(Conditions.any()).join(); + assertEquals(tupleCount, resultAfterInsert.size()); + + final int halfOfTupleCount = tupleCount / 2; + TarantoolTuple afterTuple = tupleFactory.create(halfOfTupleCount, + null, + String.valueOf(halfOfTupleCount), + halfOfTupleCount); + + TarantoolResult resultAfterInsertWithAfterOption = + profileSpace.select(Conditions.after(afterTuple)).join(); + assertEquals(halfOfTupleCount - 1, resultAfterInsertWithAfterOption.size()); + } }