mirror of
https://github.com/android10/Android-CleanArchitecture.git
synced 2026-03-13 10:13:41 +08:00
Minor refactor.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,7 +16,6 @@
|
||||
package com.fernandocejas.android10.sample.data.exception;
|
||||
|
||||
import com.fernandocejas.android10.sample.domain.exception.ErrorBundle;
|
||||
import com.fernandocejas.frodo.core.strings.Strings;
|
||||
|
||||
/**
|
||||
* Wrapper around Exceptions used to manage errors in the repository.
|
||||
@@ -36,7 +35,7 @@ public class RepositoryErrorBundle implements ErrorBundle {
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
String message = Strings.EMPTY;
|
||||
String message = "";
|
||||
if (this.exception != null) {
|
||||
message = this.exception.getMessage();
|
||||
}
|
||||
|
||||
@@ -92,11 +92,11 @@ public class RestApiImpl implements RestApi {
|
||||
}
|
||||
|
||||
private String getUserEntitiesFromApi() throws MalformedURLException {
|
||||
return ApiConnection.createGET(RestApi.API_URL_GET_USER_LIST).requestSyncCall();
|
||||
return ApiConnection.createGET(API_URL_GET_USER_LIST).requestSyncCall();
|
||||
}
|
||||
|
||||
private String getUserDetailsFromApi(int userId) throws MalformedURLException {
|
||||
String apiUrl = RestApi.API_URL_GET_USER_DETAILS + userId + ".json";
|
||||
String apiUrl = API_URL_GET_USER_DETAILS + userId + ".json";
|
||||
return ApiConnection.createGET(apiUrl).requestSyncCall();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import rx.functions.Action1;
|
||||
/**
|
||||
* {@link UserDataStore} implementation based on connections to the api (Cloud).
|
||||
*/
|
||||
public class CloudUserDataStore implements UserDataStore {
|
||||
class CloudUserDataStore implements UserDataStore {
|
||||
|
||||
private final RestApi restApi;
|
||||
private final UserCache userCache;
|
||||
@@ -42,7 +42,7 @@ public class CloudUserDataStore implements UserDataStore {
|
||||
* @param restApi The {@link RestApi} implementation to use.
|
||||
* @param userCache A {@link UserCache} to cache data retrieved from the api.
|
||||
*/
|
||||
public CloudUserDataStore(RestApi restApi, UserCache userCache) {
|
||||
CloudUserDataStore(RestApi restApi, UserCache userCache) {
|
||||
this.restApi = restApi;
|
||||
this.userCache = userCache;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import rx.Observable;
|
||||
/**
|
||||
* {@link UserDataStore} implementation based on file system data store.
|
||||
*/
|
||||
public class DiskUserDataStore implements UserDataStore {
|
||||
class DiskUserDataStore implements UserDataStore {
|
||||
|
||||
private final UserCache userCache;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DiskUserDataStore implements UserDataStore {
|
||||
*
|
||||
* @param userCache A {@link UserCache} to cache data retrieved from the api.
|
||||
*/
|
||||
public DiskUserDataStore(UserCache userCache) {
|
||||
DiskUserDataStore(UserCache userCache) {
|
||||
this.userCache = userCache;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,5 +24,5 @@ import org.robolectric.annotation.Config;
|
||||
* Inherit from this class to create a test.
|
||||
*/
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@Config(constants = BuildConfig.class, application = ApplicationStub.class)
|
||||
@Config(constants = BuildConfig.class, application = ApplicationStub.class, sdk = 21)
|
||||
public abstract class ApplicationTestCase {}
|
||||
|
||||
Reference in New Issue
Block a user