Skip to content

Commit

Permalink
Migrate Kotlin tests to separate project
Browse files Browse the repository at this point in the history
This is easier than messing with classpaths.
  • Loading branch information
JakeWharton committed Mar 30, 2022
1 parent 1a4198c commit fb62d2c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
2 changes: 0 additions & 2 deletions retrofit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ dependencies {
testImplementation libs.assertj
testImplementation libs.guava
testImplementation libs.mockwebserver
testImplementation libs.kotlinStdLib
testImplementation libs.kotlinCoroutines
}

jar {
Expand Down
2 changes: 2 additions & 0 deletions retrofit/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
POM_ARTIFACT_ID=retrofit
POM_NAME=Retrofit
POM_DESCRIPTION=A type-safe HTTP client for Android and Java.

kotlin.stdlib.default.dependency=false
11 changes: 11 additions & 0 deletions retrofit/kotlin-test/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apply plugin: 'org.jetbrains.kotlin.jvm'

dependencies {
testImplementation projects.retrofit
testImplementation projects.retrofit.testHelpers
testImplementation libs.junit
testImplementation libs.assertj
testImplementation libs.mockwebserver
testImplementation libs.kotlinStdLib
testImplementation libs.kotlinCoroutines
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import kotlin.Unit;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import retrofit2.http.GET;
Expand All @@ -45,8 +44,4 @@ public void unitOnClasspath() throws IOException {
assertThat(response.isSuccessful()).isTrue();
assertThat(response.body()).isSameAs(Unit.INSTANCE);
}

@Ignore("This is implicitly tested by integration tests of the adapters and converters")
@Test
public void unitMissingFromClasspath() {}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ rootProject.name = 'retrofit-root'

include ':retrofit'
include ':retrofit:android-test'
include ':retrofit:kotlin-test'
include ':retrofit:robovm-test'
include ':retrofit:test-helpers'

Expand Down

0 comments on commit fb62d2c

Please sign in to comment.