Skip to content

Commit

Permalink
Merge pull request #78 from prudrabhat/dev-v2.0.0_unit_functional_tests
Browse files Browse the repository at this point in the history
Remove Powermock and fix unit and functional tests
  • Loading branch information
prudrabhat authored Dec 15, 2022
2 parents 8384998 + 734d4b6 commit afebb93
Show file tree
Hide file tree
Showing 42 changed files with 2,873 additions and 3,500 deletions.
2 changes: 1 addition & 1 deletion code/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ext {

// test dependencies
junitVersion = "1.1.3"
mockitoCoreVersion = "2.28.2"
mockitoVersion = "4.5.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

// spotless
Expand Down
27 changes: 7 additions & 20 deletions code/edgeidentity/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,6 @@ android {
sourceCompatibility rootProject.ext.sourceCompatibility
targetCompatibility rootProject.ext.targetCompatibility
}

sourceSets {
String sharedTestUtilJavaDir = 'src/sharedTestUtils/java'

test {
java.srcDirs += [sharedTestUtilJavaDir]
}

androidTest {
java.srcDirs += [sharedTestUtilJavaDir]
}
}
}

afterEvaluate {
Expand Down Expand Up @@ -227,20 +215,19 @@ dependencies {
implementation 'androidx.annotation:annotation:1.3.0'

testImplementation "androidx.test.ext:junit:${rootProject.ext.junitVersion}"
testImplementation "org.mockito:mockito-core:${rootProject.ext.mockitoCoreVersion}"
testImplementation "org.mockito:mockito-core:${rootProject.ext.mockitoVersion}"
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.9.9'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.0'
testImplementation 'org.powermock:powermock-module-junit4:2.0.0'
testImplementation 'org.json:json:20180813'

androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.junitVersion}"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// Using older version of PowerMock as it supports minimum Android API < 26
// the root issue appears to be a dependency with Objenesis in Mockito-Core
// where Objenesis 2 requires minimum Android API 26
androidTestImplementation 'org.powermock:powermock-module-junit4:1+'
androidTestImplementation 'com.fasterxml.jackson.core:jackson-databind:2.9.9'
androidTestImplementation "com.adobe.marketing.mobile:identity:1.+"

// TODO: Uncomment next line when Identity 2.0 artifacts are published to maven
// implementation "com.adobe.marketing.mobile:identity:2.+"
androidTestImplementation ("com.github.adobe.aepsdk-core-android:identity:dev-v2.0.0-SNAPSHOT") {
transitive = false
}
}

tasks.withType(Test) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Copyright 2022 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
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
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

package com.adobe.marketing.mobile;

/**
* Helper class that exists as a way to access test helper methods provided in core
* within the package com.adobe.marketing.mobile
*/
public class MobileCoreHelper {

/**
* Wrapper around {@link MobileCore#resetSDK()}
*/
public static void resetSDK() {
MobileCore.resetSDK();
}
}

This file was deleted.

Loading

0 comments on commit afebb93

Please sign in to comment.