Skip to content

Commit e0fbb52

Browse files
committed
fix: ParseCorePluginsTest.testQueryControllerDefaultImpl
1 parent 4249904 commit e0fbb52

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

parse/src/main/java/com/parse/ParseCorePlugins.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public ParseQueryController getQueryController() {
155155
new NetworkQueryController(ParsePlugins.get().restClient());
156156
ParseQueryController controller;
157157
// TODO(grantland): Do not rely on Parse global
158-
if (Parse.isLocalDatastoreEnabled()) {
158+
if (ParsePlugins.get().isLocalDatastoreEnabled()) {
159159
controller =
160160
new OfflineQueryController(Parse.getLocalDatastore(), networkController);
161161
} else {

parse/src/main/java/com/parse/ParsePlugins.java

+4
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ Context applicationContext() {
9393
return applicationContext;
9494
}
9595

96+
boolean isLocalDatastoreEnabled() {
97+
return configuration.localDataStoreEnabled;
98+
}
99+
96100
ParseHttpClient fileClient() {
97101
synchronized (lock) {
98102
if (fileClient == null) {

parse/src/test/java/com/parse/EventuallyPinTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void testFailingFindAllPinned() throws Exception {
4848
ParsePlugins plugins = mock(ParsePlugins.class);
4949
ParsePlugins.set(plugins);
5050
when(plugins.restClient()).thenReturn(ParseHttpClient.createClient(null));
51+
when(plugins.isLocalDatastoreEnabled()).thenReturn(true);
5152

5253
thrown.expect(SQLiteException.class);
5354

parse/src/test/java/com/parse/ParseUserTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,7 @@ public void testSaveEventuallyWhenServerError() throws Exception {
15751575
ParseHttpClient restClient =
15761576
ParseTestUtils.mockParseHttpClientWithResponse(mockResponse, 200, "OK");
15771577
when(plugins.restClient()).thenReturn(restClient);
1578+
when(plugins.isLocalDatastoreEnabled()).thenReturn(true);
15781579
Parse.initialize(configuration, plugins);
15791580

15801581
ParseUser user = ParseUser.logIn("username", "password");

0 commit comments

Comments
 (0)