diff --git a/build.gradle b/build.gradle index 5943fd2..569ef76 100644 --- a/build.gradle +++ b/build.gradle @@ -19,18 +19,18 @@ apply plugin: 'com.android.library' apply plugin: 'com.f2prateek.javafmt' android { - compileSdkVersion 26 + compileSdkVersion 33 buildToolsVersion '29.0.2' defaultConfig { minSdkVersion 14 - targetSdkVersion 26 + targetSdkVersion 33 compileSdkVersion 23 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } lintOptions { @@ -38,6 +38,12 @@ android { disable 'InvalidPackage' abortOnError false } + + testOptions { + unitTests { + includeAndroidResources = true + } + } } dependencies { @@ -47,27 +53,27 @@ dependencies { google() } - compileOnly 'com.segment.analytics.android:analytics:4.10.0' + // update + compileOnly 'com.segment.analytics.android:analytics:4.11.0' - api 'com.adjust.sdk:adjust-android:4.29.1' + api 'com.adjust.sdk:adjust-android:4.33.3' - testImplementation 'junit:junit:4.12' - testImplementation('org.robolectric:robolectric:3.3.2') { + testImplementation 'junit:junit:4.13.2' + testImplementation('org.robolectric:robolectric:4.7.3') { exclude group: 'commons-logging', module: 'commons-logging' exclude group: 'org.apache.httpcomponents', module: 'httpclient' } testImplementation 'com.segment.analytics.android:analytics-tests:4.0.0' - testImplementation 'org.assertj:assertj-core:1.7.1' - - testImplementation 'org.mockito:mockito-core:1.10.19' + testImplementation 'org.assertj:assertj-core:2.6.0' - testImplementation 'org.powermock:powermock:1.6.2' - testImplementation 'org.powermock:powermock-module-junit4:1.6.2' - testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.2' - testImplementation 'org.powermock:powermock-api-mockito:1.6.2' - testImplementation 'org.powermock:powermock-classloading-xstream:1.6.2' + def powerMockVersion = '2.0.9' + testImplementation "org.powermock:powermock-core:$powerMockVersion" + testImplementation "org.powermock:powermock-module-junit4:$powerMockVersion" + testImplementation "org.powermock:powermock-module-junit4-rule:$powerMockVersion" + testImplementation "org.powermock:powermock-api-mockito2:$powerMockVersion" + testImplementation "org.powermock:powermock-classloading-xstream:$powerMockVersion" } repositories { diff --git a/src/test/java/com/segment/analytics/android/integrations/adjust/AdjustIntegrationTest.java b/src/test/java/com/segment/analytics/android/integrations/adjust/AdjustIntegrationTest.java index 43f7d98..50cb129 100644 --- a/src/test/java/com/segment/analytics/android/integrations/adjust/AdjustIntegrationTest.java +++ b/src/test/java/com/segment/analytics/android/integrations/adjust/AdjustIntegrationTest.java @@ -30,6 +30,7 @@ import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; + import static com.segment.analytics.Analytics.LogLevel.NONE; import static com.segment.analytics.Analytics.LogLevel.VERBOSE; import static com.segment.analytics.Utils.createTraits; @@ -43,9 +44,9 @@ import static org.mockito.MockitoAnnotations.initMocks; @RunWith(RobolectricTestRunner.class) -@Config(constants = BuildConfig.class, sdk = 18, manifest = Config.NONE) +@Config(sdk = 29, manifest = Config.NONE) @PowerMockIgnore({ "org.mockito.*", "org.robolectric.*", "android.*" }) -@PrepareForTest({ Adjust.class, AdjustConfig.class, AdjustEvent.class, AdjustIntegration.class }) // +@PrepareForTest({ Adjust.class, AdjustConfig.class, AdjustIntegration.class }) // public class AdjustIntegrationTest { @Rule public PowerMockRule rule = new PowerMockRule(); @Mock Application application;