diff --git a/.github/project.yml b/.github/project.yml index e515c70..bc6da64 100644 --- a/.github/project.yml +++ b/.github/project.yml @@ -1,5 +1,5 @@ name: Quarkiverse Mockk Extension release: - current-version: 1.1.1 - next-version: 1.2.0-SNAPSHOT + current-version: 2.1.0 + next-version: 2.2.0-SNAPSHOT diff --git a/README.md b/README.md index f3cd255..82aedfc 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ dependencies { ## Compatibility with Quarkus -Starting with Quarkus `2.8` and above, version `1.1.0` of `quarkus-junit5-mockk` should be used. +Starting with version ˋ3+`, version `2.0.0` of `quarkus-junit5-mockk` should be used. +If you use a version between `2.8` and before `3.0.0`, version `1.1.0` of `quarkus-junit5-mockk` should be used. If you use a version before `2.7`, version `1.0.1` of `quarkus-junit5-mockk` should be used. ## Example diff --git a/docs/antora.yml b/docs/antora.yml index 83d5f00..b10d20d 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -1,5 +1,5 @@ name: quarkus-mockk -title: Quarkus Mockk +title: Mockk version: dev nav: - modules/ROOT/nav.adoc diff --git a/docs/modules/ROOT/pages/injectmock.adoc b/docs/modules/ROOT/pages/injectmock.adoc index 0700cbe..02a6890 100644 --- a/docs/modules/ROOT/pages/injectmock.adoc +++ b/docs/modules/ROOT/pages/injectmock.adoc @@ -5,7 +5,7 @@ This annotation allows you to inject MockK mocks in your application. This annotation has three parameters: * `relaxed`, if set to `true`, all function will return simple values. Default to `false`. -* `relacUnitFun`, if set to `true`, `Unit` function will be relaxed. Default to `false`. +* `relaxUnitFun`, if set to `true`, `Unit` function will be relaxed. Default to `false`. * `convertScopes`, it set to `true`, convert the `@Singleton` scope of bean to `@ApplicationScoped`. This allows to mock singleton beans == Example @@ -58,4 +58,4 @@ class InjectionMockTest { assertThat(firstService.greet()).isEqualTo("test") } } ----- \ No newline at end of file +---- diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 2152573..126b90f 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -5,7 +5,7 @@ io.quarkiverse.mockk quarkus-junit5-mockk-parent - 1.2.0-SNAPSHOT + 2.2.0-SNAPSHOT ../pom.xml diff --git a/integration-tests/src/main/kotlin/org/acme/MessageService.kt b/integration-tests/src/main/kotlin/org/acme/MessageService.kt index 2be852f..4530670 100644 --- a/integration-tests/src/main/kotlin/org/acme/MessageService.kt +++ b/integration-tests/src/main/kotlin/org/acme/MessageService.kt @@ -1,6 +1,6 @@ package org.acme -import javax.enterprise.context.ApplicationScoped +import jakarta.enterprise.context.ApplicationScoped @ApplicationScoped class MessageService { diff --git a/integration-tests/src/main/kotlin/org/acme/SingletonService.kt b/integration-tests/src/main/kotlin/org/acme/SingletonService.kt index 940d98c..623027b 100644 --- a/integration-tests/src/main/kotlin/org/acme/SingletonService.kt +++ b/integration-tests/src/main/kotlin/org/acme/SingletonService.kt @@ -1,6 +1,6 @@ package org.acme -import javax.inject.Singleton +import jakarta.inject.Singleton @Singleton open class SingletonService { diff --git a/integration-tests/src/main/kotlin/org/acme/SuffixService.kt b/integration-tests/src/main/kotlin/org/acme/SuffixService.kt index 43ebb2b..eafd301 100644 --- a/integration-tests/src/main/kotlin/org/acme/SuffixService.kt +++ b/integration-tests/src/main/kotlin/org/acme/SuffixService.kt @@ -1,6 +1,6 @@ package org.acme -import javax.enterprise.context.ApplicationScoped +import jakarta.enterprise.context.ApplicationScoped @ApplicationScoped class SuffixService { diff --git a/integration-tests/src/main/kotlin/org/acme/resource/RestRessource.kt b/integration-tests/src/main/kotlin/org/acme/resource/RestRessource.kt index 1d6d552..6f6a1e0 100644 --- a/integration-tests/src/main/kotlin/org/acme/resource/RestRessource.kt +++ b/integration-tests/src/main/kotlin/org/acme/resource/RestRessource.kt @@ -2,8 +2,8 @@ package org.acme.resource import org.acme.MessageService import org.acme.SuffixService -import javax.ws.rs.GET -import javax.ws.rs.Path +import jakarta.ws.rs.GET +import jakarta.ws.rs.Path @Path("/message") class RestRessource(val messageService: MessageService, val suffixService: SuffixService) { diff --git a/junit5-mockk/pom.xml b/junit5-mockk/pom.xml index b36056e..29568ac 100644 --- a/junit5-mockk/pom.xml +++ b/junit5-mockk/pom.xml @@ -5,7 +5,7 @@ io.quarkiverse.mockk quarkus-junit5-mockk-parent - 1.2.0-SNAPSHOT + 2.2.0-SNAPSHOT ../pom.xml diff --git a/junit5-mockk/src/main/kotlin/io/quarkiverse/test/junit/mockk/internal/CreateMockkSpiesCallback.kt b/junit5-mockk/src/main/kotlin/io/quarkiverse/test/junit/mockk/internal/CreateMockkSpiesCallback.kt index 6b694ae..55d7a77 100644 --- a/junit5-mockk/src/main/kotlin/io/quarkiverse/test/junit/mockk/internal/CreateMockkSpiesCallback.kt +++ b/junit5-mockk/src/main/kotlin/io/quarkiverse/test/junit/mockk/internal/CreateMockkSpiesCallback.kt @@ -2,7 +2,7 @@ package io.quarkiverse.test.junit.mockk.internal import io.mockk.spyk import io.quarkiverse.test.junit.mockk.InjectSpy -import io.quarkus.arc.runtime.ClientProxyUnwrapper +import io.quarkus.arc.ClientProxy import io.quarkus.test.junit.callback.QuarkusTestAfterConstructCallback import java.lang.reflect.Field @@ -24,11 +24,10 @@ class CreateMockkSpiesCallback: QuarkusTestAfterConstructCallback { } private fun createSpyAndSetTestField(testInstance: Any, field: Field, beanInstance: Any): Any { - val unwrapper = ClientProxyUnwrapper() - val spy = spyk(unwrapper.apply(beanInstance)) + val spy = spyk(ClientProxy.unwrap(beanInstance)) if (field.trySetAccessible()) { field.set(testInstance, spy) } return spy } -} \ No newline at end of file +} diff --git a/junit5-mockk/src/main/kotlin/io/quarkiverse/test/junit/mockk/internal/ReflectionUtils.kt b/junit5-mockk/src/main/kotlin/io/quarkiverse/test/junit/mockk/internal/ReflectionUtils.kt index 10084f2..cb9e434 100644 --- a/junit5-mockk/src/main/kotlin/io/quarkiverse/test/junit/mockk/internal/ReflectionUtils.kt +++ b/junit5-mockk/src/main/kotlin/io/quarkiverse/test/junit/mockk/internal/ReflectionUtils.kt @@ -5,7 +5,7 @@ import io.quarkiverse.test.junit.mockk.InjectSpy import io.quarkus.arc.Arc import java.lang.IllegalStateException import java.lang.reflect.Field -import javax.inject.Qualifier +import jakarta.inject.Qualifier object ReflectionUtils { diff --git a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/application/SimpleSingletonBean.kt b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/application/SimpleSingletonBean.kt index 26ec84d..3aba421 100644 --- a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/application/SimpleSingletonBean.kt +++ b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/application/SimpleSingletonBean.kt @@ -1,6 +1,6 @@ package io.quarkiverse.test.junit.mockk.internal.application -import javax.inject.Singleton +import jakarta.inject.Singleton @Singleton open class SimpleSingletonBean { diff --git a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectRelaxedMockTest.kt b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectRelaxedMockTest.kt index fc7eb1b..02d931b 100644 --- a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectRelaxedMockTest.kt +++ b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectRelaxedMockTest.kt @@ -4,8 +4,8 @@ import io.mockk.verify import io.quarkiverse.test.junit.mockk.InjectMock import io.quarkus.test.junit.QuarkusTest import org.junit.jupiter.api.Test -import javax.enterprise.context.ApplicationScoped -import javax.inject.Inject +import jakarta.enterprise.context.ApplicationScoped +import jakarta.inject.Inject @QuarkusTest class InjectRelaxedMockTest { diff --git a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectRestClientTest.kt b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectRestClientTest.kt index 2f09e14..dfd08bc 100644 --- a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectRestClientTest.kt +++ b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectRestClientTest.kt @@ -9,12 +9,12 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient import org.eclipse.microprofile.rest.client.inject.RestClient import org.jboss.resteasy.annotations.jaxrs.PathParam import org.junit.jupiter.api.Test -import javax.enterprise.context.ApplicationScoped -import javax.inject.Inject -import javax.ws.rs.GET -import javax.ws.rs.Path -import javax.ws.rs.Produces -import javax.ws.rs.core.MediaType +import jakarta.enterprise.context.ApplicationScoped +import jakarta.inject.Inject +import jakarta.ws.rs.GET +import jakarta.ws.rs.Path +import jakarta.ws.rs.Produces +import jakarta.ws.rs.core.MediaType @QuarkusTest class InjectRestClientTest { diff --git a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectionMockTest.kt b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectionMockTest.kt index e85f683..ab9978a 100644 --- a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectionMockTest.kt +++ b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectionMockTest.kt @@ -6,8 +6,8 @@ import io.quarkiverse.test.junit.mockk.InjectMock import io.quarkus.test.junit.QuarkusTest import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -import javax.enterprise.context.ApplicationScoped -import javax.inject.Inject +import jakarta.enterprise.context.ApplicationScoped +import jakarta.inject.Inject @QuarkusTest class InjectionMockTest { diff --git a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectionSpyTest.kt b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectionSpyTest.kt index a330806..5ea4369 100644 --- a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectionSpyTest.kt +++ b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/InjectionSpyTest.kt @@ -5,8 +5,8 @@ import io.quarkiverse.test.junit.mockk.InjectSpy import io.quarkus.test.junit.QuarkusTest import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -import javax.enterprise.context.ApplicationScoped -import javax.inject.Inject +import jakarta.enterprise.context.ApplicationScoped +import jakarta.inject.Inject @QuarkusTest class InjectionSpyTest { diff --git a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/ReturnMutinyTypeTest.kt b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/ReturnMutinyTypeTest.kt index 6c1bcc1..2d3e14f 100644 --- a/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/ReturnMutinyTypeTest.kt +++ b/junit5-mockk/src/test/kotlin/io/quarkiverse/test/junit/mockk/internal/example/ReturnMutinyTypeTest.kt @@ -6,7 +6,7 @@ import io.quarkus.test.junit.QuarkusTest import io.smallrye.mutiny.Uni import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -import javax.enterprise.context.ApplicationScoped +import jakarta.enterprise.context.ApplicationScoped @QuarkusTest class ReturnMutinyTypeTest { diff --git a/pom.xml b/pom.xml index fb469d2..9d2f855 100644 --- a/pom.xml +++ b/pom.xml @@ -5,28 +5,34 @@ io.quarkiverse quarkiverse-parent - 10 + 15 io.quarkiverse.mockk quarkus-junit5-mockk-parent pom - 1.2.0-SNAPSHOT + 2.2.0-SNAPSHOT Quarkus - JUnit 5 - Mockk Parent - 1.7.21 - 1.13.2 - - 2.14.0.Final - 1.7.20 - 3.23.1 + 1.9.10 + 1.13.7 + 3.3.0 + 1.8.20 + 3.24.2 true 11 + + scm:git:git@github.com:quarkiverse/quarkus-mockk.git + scm:git:git@github.com:quarkiverse/quarkus-mockk.git + https://github.com/quarkiverse/quarkus-mockk + HEAD + + @@ -57,4 +63,4 @@ - \ No newline at end of file +