-
-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
191 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
public final class io/mockk/springmockk/ClearMocksTestExecutionListener : org/springframework/test/context/support/AbstractTestExecutionListener { | ||
public fun <init> ()V | ||
public fun afterTestMethod (Lorg/springframework/test/context/TestContext;)V | ||
public fun beforeTestMethod (Lorg/springframework/test/context/TestContext;)V | ||
public fun getOrder ()I | ||
} | ||
|
||
public class io/mockk/springmockk/Definition { | ||
public fun <init> (Ljava/lang/String;Lio/mockk/springmockk/MockkClear;Lio/mockk/springmockk/QualifierDefinition;)V | ||
public fun equals (Ljava/lang/Object;)Z | ||
public final fun getClear ()Lio/mockk/springmockk/MockkClear; | ||
public final fun getName ()Ljava/lang/String; | ||
public final fun getQualifier ()Lio/mockk/springmockk/QualifierDefinition; | ||
public fun hashCode ()I | ||
} | ||
|
||
public final class io/mockk/springmockk/DefinitionsParser { | ||
public fun <init> ()V | ||
public fun <init> (Ljava/util/Collection;)V | ||
public synthetic fun <init> (Ljava/util/Collection;ILkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public final fun getField (Lio/mockk/springmockk/Definition;)Ljava/lang/reflect/Field; | ||
public final fun getParsedDefinitions ()Ljava/util/Set; | ||
public final fun parse (Ljava/lang/Class;)V | ||
} | ||
|
||
public abstract interface annotation class io/mockk/springmockk/MockkBean : java/lang/annotation/Annotation { | ||
public abstract fun classes ()[Ljava/lang/Class; | ||
public abstract fun clear ()Lio/mockk/springmockk/MockkClear; | ||
public abstract fun extraInterfaces ()[Ljava/lang/Class; | ||
public abstract fun name ()Ljava/lang/String; | ||
public abstract fun relaxUnitFun ()Z | ||
public abstract fun relaxed ()Z | ||
public abstract fun value ()[Ljava/lang/Class; | ||
} | ||
|
||
public abstract interface annotation class io/mockk/springmockk/MockkBeans : java/lang/annotation/Annotation { | ||
public abstract fun value ()[Lio/mockk/springmockk/MockkBean; | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkClear : java/lang/Enum { | ||
public static final field AFTER Lio/mockk/springmockk/MockkClear; | ||
public static final field BEFORE Lio/mockk/springmockk/MockkClear; | ||
public static final field Companion Lio/mockk/springmockk/MockkClear$Companion; | ||
public static final field NONE Lio/mockk/springmockk/MockkClear; | ||
public static fun valueOf (Ljava/lang/String;)Lio/mockk/springmockk/MockkClear; | ||
public static fun values ()[Lio/mockk/springmockk/MockkClear; | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkClear$Companion { | ||
public final fun get (Ljava/lang/Object;)Lio/mockk/springmockk/MockkClear; | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkClearKt { | ||
public static final fun clear (Ljava/lang/Object;Lio/mockk/springmockk/MockkClear;)Ljava/lang/Object; | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkContextCustomizer : org/springframework/test/context/ContextCustomizer { | ||
public fun <init> (Ljava/util/Set;)V | ||
public final fun copy (Ljava/util/Set;)Lio/mockk/springmockk/MockkContextCustomizer; | ||
public static synthetic fun copy$default (Lio/mockk/springmockk/MockkContextCustomizer;Ljava/util/Set;ILjava/lang/Object;)Lio/mockk/springmockk/MockkContextCustomizer; | ||
public fun customizeContext (Lorg/springframework/context/ConfigurableApplicationContext;Lorg/springframework/test/context/MergedContextConfiguration;)V | ||
public fun equals (Ljava/lang/Object;)Z | ||
public fun hashCode ()I | ||
public fun toString ()Ljava/lang/String; | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkContextCustomizerFactory : org/springframework/test/context/ContextCustomizerFactory { | ||
public fun <init> ()V | ||
public fun createContextCustomizer (Ljava/lang/Class;Ljava/util/List;)Lorg/springframework/test/context/ContextCustomizer; | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkDefinition : io/mockk/springmockk/Definition { | ||
public fun <init> (Ljava/lang/String;Lorg/springframework/core/ResolvableType;[Lkotlin/reflect/KClass;Lio/mockk/springmockk/MockkClear;ZZLio/mockk/springmockk/QualifierDefinition;)V | ||
public synthetic fun <init> (Ljava/lang/String;Lorg/springframework/core/ResolvableType;[Lkotlin/reflect/KClass;Lio/mockk/springmockk/MockkClear;ZZLio/mockk/springmockk/QualifierDefinition;ILkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public final fun createMock ()Ljava/lang/Object; | ||
public final fun createMock (Ljava/lang/String;)Ljava/lang/Object; | ||
public fun equals (Ljava/lang/Object;)Z | ||
public final fun getExtraInterfaces ()Ljava/util/Set; | ||
public final fun getRelaxUnitFun ()Z | ||
public final fun getRelaxed ()Z | ||
public final fun getTypeToMock ()Lorg/springframework/core/ResolvableType; | ||
public fun hashCode ()I | ||
public fun toString ()Ljava/lang/String; | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkFunctionsKt { | ||
public static final fun isMock (Ljava/lang/Object;)Z | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkPostProcessor : org/springframework/beans/factory/BeanClassLoaderAware, org/springframework/beans/factory/BeanFactoryAware, org/springframework/beans/factory/config/BeanFactoryPostProcessor, org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor, org/springframework/core/Ordered { | ||
public static final field Companion Lio/mockk/springmockk/MockkPostProcessor$Companion; | ||
public fun <init> (Ljava/util/Set;)V | ||
public fun getOrder ()I | ||
public fun postProcessBeanFactory (Lorg/springframework/beans/factory/config/ConfigurableListableBeanFactory;)V | ||
public fun postProcessProperties (Lorg/springframework/beans/PropertyValues;Ljava/lang/Object;Ljava/lang/String;)Lorg/springframework/beans/PropertyValues; | ||
public fun setBeanClassLoader (Ljava/lang/ClassLoader;)V | ||
public fun setBeanFactory (Lorg/springframework/beans/factory/BeanFactory;)V | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkPostProcessor$Companion { | ||
public final fun register (Lorg/springframework/beans/factory/support/BeanDefinitionRegistry;Ljava/lang/Class;Ljava/util/Set;)V | ||
public static synthetic fun register$default (Lio/mockk/springmockk/MockkPostProcessor$Companion;Lorg/springframework/beans/factory/support/BeanDefinitionRegistry;Ljava/lang/Class;Ljava/util/Set;ILjava/lang/Object;)V | ||
} | ||
|
||
public final class io/mockk/springmockk/MockkTestExecutionListener : org/springframework/test/context/support/AbstractTestExecutionListener { | ||
public fun <init> ()V | ||
public fun beforeTestMethod (Lorg/springframework/test/context/TestContext;)V | ||
public fun getOrder ()I | ||
public fun prepareTestInstance (Lorg/springframework/test/context/TestContext;)V | ||
} | ||
|
||
public final class io/mockk/springmockk/QualifierDefinition { | ||
public static final field Companion Lio/mockk/springmockk/QualifierDefinition$Companion; | ||
public fun <init> (Ljava/lang/reflect/Field;Ljava/util/Set;)V | ||
public final fun applyTo (Lorg/springframework/beans/factory/support/RootBeanDefinition;)V | ||
public fun equals (Ljava/lang/Object;)Z | ||
public fun hashCode ()I | ||
public final fun matches (Lorg/springframework/beans/factory/config/ConfigurableListableBeanFactory;Ljava/lang/String;)Z | ||
} | ||
|
||
public final class io/mockk/springmockk/QualifierDefinition$Companion { | ||
public final fun forElement (Ljava/lang/reflect/AnnotatedElement;)Lio/mockk/springmockk/QualifierDefinition; | ||
} | ||
|
||
public abstract interface annotation class io/mockk/springmockk/SpykBean : java/lang/annotation/Annotation { | ||
public abstract fun classes ()[Ljava/lang/Class; | ||
public abstract fun clear ()Lio/mockk/springmockk/MockkClear; | ||
public abstract fun name ()Ljava/lang/String; | ||
public abstract fun value ()[Ljava/lang/Class; | ||
} | ||
|
||
public abstract interface annotation class io/mockk/springmockk/SpykBeans : java/lang/annotation/Annotation { | ||
public abstract fun value ()[Lio/mockk/springmockk/SpykBean; | ||
} | ||
|
||
public final class io/mockk/springmockk/SpykDefinition : io/mockk/springmockk/Definition { | ||
public fun <init> (Ljava/lang/String;Lorg/springframework/core/ResolvableType;Lio/mockk/springmockk/MockkClear;Lio/mockk/springmockk/QualifierDefinition;)V | ||
public synthetic fun <init> (Ljava/lang/String;Lorg/springframework/core/ResolvableType;Lio/mockk/springmockk/MockkClear;Lio/mockk/springmockk/QualifierDefinition;ILkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public final fun createSpy (Ljava/lang/Object;)Ljava/lang/Object; | ||
public final fun createSpy (Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object; | ||
public fun equals (Ljava/lang/Object;)Z | ||
public final fun getTypeToSpy ()Lorg/springframework/core/ResolvableType; | ||
public fun hashCode ()I | ||
public fun toString ()Ljava/lang/String; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,168 +1,45 @@ | ||
import buildsrc.config.Deps | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
import java.time.Duration | ||
|
||
plugins { | ||
// if it's changed, it must also be changed in the bomProperty below | ||
val kotlinVersion = "1.7.21" | ||
|
||
`java-library` | ||
kotlin("jvm") version kotlinVersion | ||
`maven-publish` | ||
signing | ||
id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion | ||
id("org.jetbrains.kotlin.plugin.noarg") version kotlinVersion | ||
id("org.springframework.boot") version "3.0.0" apply false | ||
id("io.spring.dependency-management") version "1.1.0" | ||
id("io.github.gradle-nexus.publish-plugin") version "1.1.0" | ||
buildsrc.convention.`kotlin-jvm` | ||
buildsrc.convention.`mockk-publishing` | ||
} | ||
|
||
group = "io.mockk" | ||
version = "4.0.2" | ||
description = "MockBean and SpyBean, but for MockK instead of Mockito" | ||
|
||
val sonatypeUsername = project.findProperty("sonatypeUsername")?.toString() ?: "" | ||
val sonatypePassword = project.findProperty("sonatypePassword")?.toString() ?: "" | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
withJavadocJar() | ||
withSourcesJar() | ||
tasks.withType<JavaCompile>().configureEach { | ||
sourceCompatibility = JavaVersion.VERSION_17.toString() | ||
targetCompatibility = JavaVersion.VERSION_17.toString() | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
tasks.withType<KotlinCompile>().configureEach { | ||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_17.toString() | ||
} | ||
} | ||
|
||
val sharedManifest = Action<Manifest> { | ||
attributes( | ||
"Implementation-Title" to project.name, | ||
"Implementation-Version" to project.version, | ||
"Implementation-Vendor" to "ninja-squad.com" | ||
) | ||
} | ||
|
||
tasks { | ||
withType(KotlinCompile::class.java) { | ||
kotlinOptions { | ||
freeCompilerArgs = listOf("-Xjsr305=strict", "-Xjvm-default=all") | ||
jvmTarget = "17" | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
jvmArgs( | ||
"--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED" | ||
) | ||
} | ||
|
||
withType<Jar> { | ||
manifest(sharedManifest) | ||
} | ||
|
||
register("publishToSonatypeAndClose") { | ||
group = "Maven Central Release" | ||
description = "Publishes to the Sonatype OSSRH repository and closes, but does not do the final release to Maven Central" | ||
|
||
dependsOn("publishToSonatype") | ||
dependsOn("closeSonatypeStagingRepository") | ||
} | ||
|
||
register("publishToSonatypeAndCloseAndReleaseToMavenCentral") { | ||
group = "Maven Central Release" | ||
description = "Publishes to the Sonatype OSSRH repository and closes, then does the final release to Maven Central" | ||
|
||
dependsOn("publishToSonatype") | ||
dependsOn("closeAndReleaseSonatypeStagingRepository") | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
tasks.named("closeSonatypeStagingRepository") { | ||
mustRunAfter("publishToSonatype") | ||
} | ||
tasks.named("closeAndReleaseSonatypeStagingRepository") { | ||
mustRunAfter("publishToSonatype") | ||
} | ||
} | ||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES) { | ||
bomProperty("kotlin.version", "1.7.21") | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
api("io.mockk:mockk-jvm:1.13.3") | ||
|
||
implementation("org.jetbrains.kotlin:kotlin-reflect") | ||
implementation("org.springframework.boot:spring-boot-test") | ||
implementation("org.springframework:spring-test") | ||
implementation("org.springframework:spring-context") | ||
|
||
testImplementation("org.assertj:assertj-core") | ||
testImplementation("org.junit.jupiter:junit-jupiter-api") | ||
testImplementation("org.junit.jupiter:junit-jupiter-params") | ||
|
||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
from(components["java"]) | ||
|
||
pom { | ||
name.set(project.name) | ||
description.set(project.description) | ||
url.set("https://github.com/mockk/springmockk") | ||
organization { | ||
name.set("mockk") | ||
url.set("https://github.com/mockk") | ||
} | ||
licenses { | ||
license { | ||
name.set("Apache License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0") | ||
distribution.set("repo") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("jnizet") | ||
name.set("Jean-Baptiste Nizet") | ||
email.set("jb@ninja-squad.com") | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:git://github.com/mockk/springmockk") | ||
developerConnection.set("scm:git:git://github.com/mockk/springmockk") | ||
url.set("https://github.com/mockk/springmockk") | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = "build" | ||
url = uri("$buildDir/repo") | ||
} | ||
} | ||
} | ||
api(projects.modules.mockk) | ||
implementation(Deps.Libs.kotlinReflect) | ||
|
||
signing { | ||
sign(publishing.publications["maven"]) | ||
} | ||
implementation(Deps.Libs.springBootTest) | ||
implementation(Deps.Libs.springTest) | ||
implementation(Deps.Libs.springContext) | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
username.set(sonatypeUsername) | ||
password.set(sonatypePassword) | ||
} | ||
} | ||
connectTimeout.set(Duration.ofMinutes(3)) | ||
clientTimeout.set(Duration.ofMinutes(3)) | ||
testImplementation(Deps.Libs.junit4) | ||
testImplementation(Deps.Libs.junitJupiter) | ||
testImplementation(Deps.Libs.junitJupiterParams) | ||
testImplementation(Deps.Libs.assertj) | ||
} |
Oops, something went wrong.