Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agologan committed May 21, 2023
1 parent 85bcd65 commit 49002a1
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 17 deletions.
3 changes: 3 additions & 0 deletions config/coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ android {
}
}
}
unitTestVariants.all {
it.mergedFlavor.manifestPlaceholders = ['appAuthRedirectScheme': 'net.openid.appauthdemo']
}
}

task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
Expand Down
6 changes: 3 additions & 3 deletions config/testdeps.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.mockito:mockito-core:3.10.0'
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.robolectric:robolectric:4.9'
testImplementation 'org.assertj:assertj-core:3.19.0'
testImplementation 'androidx.test.ext:junit:1.1.3'
testImplementation 'androidx.test.ext:truth:1.3.0'
testImplementation 'androidx.test.ext:junit:1.1.5'
testImplementation 'androidx.test.ext:truth:1.5.0'
testImplementation 'com.google.truth:truth:1.1.3'
testImplementation 'xmlpull:xmlpull:1.1.3.1'
5 changes: 2 additions & 3 deletions library/javatests/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
* limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="net.openid.appauth">
xmlns:tools="http://schemas.android.com/tools">

<application>
<activity android:name=".RedirectUriReceiverActivity"
android:exported="true" tools:node="replace">
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import androidx.browser.customtabs.CustomTabsServiceConnection;
import androidx.browser.customtabs.CustomTabsSession;
import java.util.List;
import net.openid.appauth.BuildConfig;

import org.junit.After;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.Collections;
import java.util.HashSet;

import net.openid.appauth.BuildConfig;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import android.util.Log;

import net.openid.appauth.BuildConfig;

import org.junit.After;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import android.os.Bundle;
import androidx.browser.customtabs.CustomTabsService;

import net.openid.appauth.BuildConfig;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -66,7 +64,7 @@ public void testFormUrlEncode_withSpaceSeparatedValueForParameter() {
parameters.put("test2", "value2 value3");
String query = UriUtil.formUrlEncode(parameters);

assertThat(query.contains("value2+value3"));
assertThat(query).contains("value2+value3");
mSanitizer.parseQuery(query);
for (Map.Entry<String, String> param : parameters.entrySet()) {
assertThat(mSanitizer.getValue(param.getKey())).isEqualTo(param.getValue());
Expand Down

0 comments on commit 49002a1

Please sign in to comment.