@Test public void testFindAsyncWithSessionToken() throws Exception { JSONObject mockResponse = generateBasicMockResponse(); mockResponse.put("trace", "serverTrace"); ParseHttpClient restClient = ParseTestUtils.mockParseHttpClientWithResponse(mockResponse, 200, "OK"); ParseQuery.State mockState = mock(ParseQuery.State.class); when(mockState.className()).thenReturn("Test"); when(mockState.selectedKeys()).thenReturn(null); when(mockState.constraints()).thenReturn(new ParseQuery.QueryConstraints()); NetworkQueryController controller = new NetworkQueryController(restClient); Task<List<ParseObject>> findTask = controller.findAsync(mockState, "sessionToken", null); ParseTaskUtils.wait(findTask); List<ParseObject> objects = findTask.getResult(); verifyBasicParseObjects(mockResponse, objects, "Test"); }
@Override public <T extends ParseObject> Task<List<T>> findAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { String sessionToken = user != null ? user.getSessionToken() : null; return findAsync(state, sessionToken, cancellationToken); }
NetworkQueryController extends AbstractQueryController { @Override public <T extends ParseObject> Task<List<T>> findAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { String sessionToken = user != null ? user.getSessionToken() : null; return findAsync(state, sessionToken, cancellationToken); } }
NetworkQueryController extends AbstractQueryController { @Override public <T extends ParseObject> Task<List<T>> findAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { String sessionToken = user != null ? user.getSessionToken() : null; return findAsync(state, sessionToken, cancellationToken); } NetworkQueryController(ParseHttpClient restClient); }
NetworkQueryController extends AbstractQueryController { @Override public <T extends ParseObject> Task<List<T>> findAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { String sessionToken = user != null ? user.getSessionToken() : null; return findAsync(state, sessionToken, cancellationToken); } NetworkQueryController(ParseHttpClient restClient); @Override Task<List<T>> findAsync(
            ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken); @Override Task<Integer> countAsync(
            ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken); }
NetworkQueryController extends AbstractQueryController { @Override public <T extends ParseObject> Task<List<T>> findAsync( ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken) { String sessionToken = user != null ? user.getSessionToken() : null; return findAsync(state, sessionToken, cancellationToken); } NetworkQueryController(ParseHttpClient restClient); @Override Task<List<T>> findAsync(
            ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken); @Override Task<Integer> countAsync(
            ParseQuery.State<T> state, ParseUser user, Task<Void> cancellationToken);  }