Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #167 from kuzzleio/fix-listIndexes
Browse files Browse the repository at this point in the history
Fix listIndexes
  • Loading branch information
jenow committed Feb 19, 2019
2 parents ebb4ff9 + 9d951fa commit abe5ebc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can configure your Android project to get Kuzzle's Android SDK from jcenter
}

dependencies {
compile 'io.kuzzle:sdk-android:3.0.4'
compile 'io.kuzzle:sdk-android:3.0.5'
}

## Basic usage
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'jacoco-android'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
version = "3.0.4"
version = "3.0.5"
buildscript {
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kuzzle/sdk/core/Kuzzle.java
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ public void listIndexes(final Options options, @NonNull final ResponseListener<S
@Override
public void onSuccess(JSONObject response) {
try {
JSONArray array = response.getJSONObject("result").getJSONArray("hits");
JSONArray array = response.getJSONObject("result").getJSONArray("indexes");
int length = array.length();
String[] indexes = new String[length];
for (int i = 0; i < length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/kuzzle/test/core/Kuzzle/listIndexesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testListIndexesException() throws JSONException {
doAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
((OnQueryDoneListener) invocation.getArguments()[3]).onSuccess(new JSONObject().put("result", new JSONObject().put("hits", new JSONArray().put("foo"))));
((OnQueryDoneListener) invocation.getArguments()[3]).onSuccess(new JSONObject().put("result", new JSONObject().put("indexes", new JSONArray().put("foo"))));
return null;
}
}).when(kuzzle).query(any(io.kuzzle.sdk.core.Kuzzle.QueryArgs.class), any(JSONObject.class), any(Options.class), any(OnQueryDoneListener.class));
Expand All @@ -93,7 +93,7 @@ public void testListIndexes() throws JSONException {
doAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
((OnQueryDoneListener) invocation.getArguments()[3]).onSuccess(new JSONObject().put("result", new JSONObject().put("hits", new JSONArray().put("foo"))));
((OnQueryDoneListener) invocation.getArguments()[3]).onSuccess(new JSONObject().put("result", new JSONObject().put("indexes", new JSONArray().put("foo"))));
((OnQueryDoneListener) invocation.getArguments()[3]).onError(mock(JSONObject.class));
return null;
}
Expand Down

0 comments on commit abe5ebc

Please sign in to comment.