diff --git a/java-client/build.gradle.kts b/java-client/build.gradle.kts index 83bfe938e8..b3cd5e8512 100644 --- a/java-client/build.gradle.kts +++ b/java-client/build.gradle.kts @@ -239,6 +239,9 @@ dependencies { testImplementation("junit", "junit" , "4.13.2") { exclude(group = "org.hamcrest") } + + // Apache 2.0 + testImplementation("org.wiremock", "wiremock", "3.9.2") } licenseReport { @@ -351,43 +354,40 @@ publishing { } if (runtimeJavaVersion >= JavaVersion.VERSION_11) { - val java11: SourceSet = sourceSets.create("java11") { - java { - compileClasspath += sourceSets.main.get().output + sourceSets.test.get().output - runtimeClasspath += sourceSets.main.get().output + sourceSets.test.get().output - srcDir("src/test/java11") - } + val java11: SourceSet = sourceSets.create("java11") { + java { + compileClasspath += sourceSets.main.get().output + sourceSets.test.get().output + runtimeClasspath += sourceSets.main.get().output + sourceSets.test.get().output + srcDir("src/test/java11") } + } - configurations[java11.implementationConfigurationName].extendsFrom(configurations.testImplementation.get()) - configurations[java11.runtimeOnlyConfigurationName].extendsFrom(configurations.testRuntimeOnly.get()) - - dependencies { - testImplementation("org.opensearch.test", "framework", opensearchVersion) { - exclude(group = "org.hamcrest") - } - - // Apache 2.0 - testImplementation("org.wiremock", "wiremock", "3.9.2") - } - - tasks.named("compileJava11Java") { - targetCompatibility = JavaVersion.VERSION_11.toString() - sourceCompatibility = JavaVersion.VERSION_11.toString() - } - - tasks.named("compileTestJava") { - targetCompatibility = JavaVersion.VERSION_11.toString() - sourceCompatibility = JavaVersion.VERSION_11.toString() - } - - tasks.named("integrationTest") { - testClassesDirs += java11.output.classesDirs - classpath = sourceSets["java11"].runtimeClasspath - } + configurations[java11.implementationConfigurationName].extendsFrom(configurations.testImplementation.get()) + configurations[java11.runtimeOnlyConfigurationName].extendsFrom(configurations.testRuntimeOnly.get()) - tasks.named("unitTest") { - testClassesDirs += java11.output.classesDirs - classpath = sourceSets["java11"].runtimeClasspath + dependencies { + testImplementation("org.opensearch.test", "framework", opensearchVersion) { + exclude(group = "org.hamcrest") } + } + + tasks.named("compileJava11Java") { + targetCompatibility = JavaVersion.VERSION_11.toString() + sourceCompatibility = JavaVersion.VERSION_11.toString() + } + + tasks.named("compileTestJava") { + targetCompatibility = JavaVersion.VERSION_11.toString() + sourceCompatibility = JavaVersion.VERSION_11.toString() + } + + tasks.named("integrationTest") { + testClassesDirs += java11.output.classesDirs + classpath = sourceSets["java11"].runtimeClasspath + } + + tasks.named("unitTest") { + testClassesDirs += java11.output.classesDirs + classpath = sourceSets["java11"].runtimeClasspath + } } diff --git a/java-client/src/test/java11/org/opensearch/client/transport/aws/AwsSdk2TransportTests.java b/java-client/src/test/java/org/opensearch/client/transport/aws/AwsSdk2TransportTests.java similarity index 100% rename from java-client/src/test/java11/org/opensearch/client/transport/aws/AwsSdk2TransportTests.java rename to java-client/src/test/java/org/opensearch/client/transport/aws/AwsSdk2TransportTests.java