.setSorting(new Sorting(ENTITY_NAME_KEY, Sorting.Order.ASC)).build(), programRecord); Assert.assertNotNull(response.getCursor()); response = assertInOrder(mds, SearchRequest.of("*").addNamespace(ns1).setLimit(1).setCursorRequested(true) .setCursor(response.getCursor()).setSorting(new Sorting(ENTITY_NAME_KEY, Sorting.Order.ASC)) .build(), datasetRecord); Assert.assertNotNull(response.getCursor()); response = assertInOrder(mds, SearchRequest.of("*").addNamespace(ns1).setLimit(1).setCursorRequested(true) .setCursor(response.getCursor()).setSorting(new Sorting(ENTITY_NAME_KEY, Sorting.Order.ASC)) .build(), appRecord); Assert.assertNull(response.getCursor()); .setSorting(new Sorting(ENTITY_NAME_KEY, Sorting.Order.ASC)).build(), programRecord, datasetRecord); Assert.assertNotNull(response.getCursor()); Assert.assertEquals(3, response.getTotalResults()); response = assertInOrder(mds, SearchRequest.of("*").addNamespace(ns1).setLimit(2).setCursorRequested(true) .setCursor(response.getCursor()).setSorting(new Sorting(ENTITY_NAME_KEY, Sorting.Order.ASC)) .build(), appRecord); Assert.assertNull(response.getCursor());