Skip to content

Commit

Permalink
Merge pull request #132 from auth0/fix-locale-tests
Browse files Browse the repository at this point in the history
Fix default Locale tests
  • Loading branch information
lbalmaceda authored Nov 17, 2017
2 parents ba14cc5 + 1b89cba commit 465de26
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion auth0/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ dependencies {
testCompile 'org.hamcrest:java-hamcrest:2.0.0.0'
testCompile 'org.powermock:powermock-module-junit4:1.6.5'
testCompile 'org.powermock:powermock-module-junit4-rule:1.6.5'
testCompile 'org.powermock:powermock-classloading-xstream:1.6.5'
testCompile 'org.powermock:powermock-api-mockito:1.6.5'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'com.squareup.okhttp:mockwebserver:2.7.5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

public class RequestFactory {

public static final String DEFAULT_LOCALE_IF_MISSING = "en_US";

private static final String AUTHORIZATION_HEADER = "Authorization";
private static final String USER_AGENT_HEADER = "User-Agent";
private static final String ACCEPT_LANGUAGE_HEADER = "Accept-Language";
Expand Down Expand Up @@ -149,6 +151,6 @@ Map<String, String> getHeaders() {

static String getDefaultLocale() {
String language = Locale.getDefault().toString();
return !language.isEmpty() ? language : "en_US";
return !language.isEmpty() ? language : DEFAULT_LOCALE_IF_MISSING;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,6 @@ private Map<String, String> bodyFromRequest(RecordedRequest request) throws java

private String getDefaultLocale() {
String language = Locale.getDefault().toString();
return !language.isEmpty() ? language : "en";
return !language.isEmpty() ? language : RequestFactory.DEFAULT_LOCALE_IF_MISSING;
}
}

0 comments on commit 465de26

Please sign in to comment.