Skip to content

Commit

Permalink
Revert back to QuarkusTestResource (#6394)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnetherton authored Aug 28, 2024
1 parent 5e17941 commit 8f2205b
Show file tree
Hide file tree
Showing 168 changed files with 343 additions and 343 deletions.
12 changes: 6 additions & 6 deletions docs/modules/ROOT/pages/user-guide/testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ public class MyTestResource implements QuarkusTestResourceLifecycleManager {
}
----

The defined test resource needs to be referenced from the test classes with `@WithTestResource` as shown below:
The defined test resource needs to be referenced from the test classes with `@QuarkusTestResource` as shown below:

[source,java]
----
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
@WithTestResource(MyTestResource.class)
@QuarkusTestResource(MyTestResource.class)
class MyTest {
...
}
Expand Down Expand Up @@ -206,16 +206,16 @@ public class WireMockTestResource implements QuarkusTestResourceLifecycleManager
}
----

Finally, ensure your test class has the `@WithTestResource` annotation with the appropriate test resource class specified as the value. The WireMock server will be started before all tests are
Finally, ensure your test class has the `@QuarkusTestResource` annotation with the appropriate test resource class specified as the value. The WireMock server will be started before all tests are
executed and will be shut down when all tests are finished.

[source,java]
----
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
@QuarkusTest
@WithTestResource(WireMockTestResource.class)
@QuarkusTestResource(WireMockTestResource.class)
class MyTest {
...
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package org.apache.camel.quarkus.component.aws2.ddb.it;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.apache.camel.quarkus.test.support.aws2.Aws2TestResource;
Expand All @@ -25,7 +25,7 @@
import static org.hamcrest.CoreMatchers.is;

@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2DdbQuarkusClientTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.Map;
import java.util.concurrent.TimeUnit;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -44,7 +44,7 @@
import static org.hamcrest.Matchers.is;

@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2CwTest extends BaseAWs2TestSupport {
private static final Logger LOG = Logger.getLogger(Aws2CwTest.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -38,7 +38,7 @@
import static org.apache.camel.quarkus.component.aws2.ddb.it.Aws2DdbResource.Table;

@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2DdbStreamTest {

private static final Logger LOG = Logger.getLogger(Aws2DdbStreamTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -42,7 +42,7 @@
import static org.hamcrest.CoreMatchers.is;

@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2DdbTest extends BaseAWs2TestSupport {

private static final Logger LOG = Logger.getLogger(Aws2DdbTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;
import java.util.concurrent.TimeUnit;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -43,7 +43,7 @@
import software.amazon.awssdk.services.s3.model.S3Object;

@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2KinesisFirehoseTest extends BaseAWs2TestSupport {

private static final Logger LOG = Logger.getLogger(Aws2KinesisFirehoseTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import java.util.concurrent.TimeUnit;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -33,7 +33,7 @@

@DisabledIfEnvironmentVariable(named = "CI", matches = "true", disabledReason = "https://github.com/apache/camel-quarkus/issues/6342")
@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2KinesisTest extends BaseAWs2TestSupport {

private static final Logger LOG = Logger.getLogger(Aws2KinesisTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -42,7 +42,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;

@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2LambdaTest extends BaseAWs2TestSupport {
private static final Logger LOG = Logger.getLogger(Aws2LambdaTest.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.UUID;
import java.util.stream.Stream;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -40,7 +40,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2S3Test extends BaseAWs2TestSupport {
private int objects_num_before;
private int objects_num_after;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand Down Expand Up @@ -57,7 +57,7 @@
@EnabledIfEnvironmentVariable(named = "AWS_ACCESS_KEY", matches = "[a-zA-Z0-9]+")
@EnabledIfEnvironmentVariable(named = "MAILSLURP_API_KEY", matches = "[a-zA-Z0-9]+")
@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2SesTest extends BaseAWs2TestSupport {
private static final Logger LOG = Logger.getLogger(Aws2SesTest.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.UUID;
import java.util.concurrent.TimeUnit;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -35,7 +35,7 @@
import static org.hamcrest.core.Is.is;

@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2SqsSnsTest extends BaseAWs2TestSupport {

public Aws2SqsSnsTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -48,7 +48,7 @@
import static org.hamcrest.Matchers.is;

@QuarkusTest
@WithTestResource(Aws2TestResource.class)
@QuarkusTestResource(Aws2TestResource.class)
class Aws2SqsTest extends BaseAWs2TestSupport {

private static final Logger LOG = Logger.getLogger(Aws2SqsTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*/
package org.apache.camel.quarkus.component.azure.storage.blob.it;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import org.apache.camel.quarkus.test.support.azure.AzureStorageTestResource;

@QuarkusIntegrationTest
@WithTestResource(AzureStorageTestResource.class)
@QuarkusTestResource(AzureStorageTestResource.class)
class AzureStorageBlobIT extends AzureStorageBlobTest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.concurrent.TimeUnit;

import com.azure.storage.blob.models.BlockListType;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -55,7 +55,7 @@
import static org.junit.jupiter.api.Assertions.fail;

@QuarkusTest
@WithTestResource(AzureStorageTestResource.class)
@QuarkusTestResource(AzureStorageTestResource.class)
class AzureStorageBlobTest {

private static final String BLOB_CONTENT = "Hello Camel Quarkus Azure Blob";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*/
package org.apache.camel.quarkus.component.azure.storage.queue.it;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusIntegrationTest;
import org.apache.camel.quarkus.test.support.azure.AzureStorageTestResource;

@QuarkusIntegrationTest
@WithTestResource(AzureStorageTestResource.class)
@QuarkusTestResource(AzureStorageTestResource.class)
class AzureStorageQueueIT extends AzureStorageQueueTest {

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;
import java.util.concurrent.TimeUnit;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -35,7 +35,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;

@QuarkusTest
@WithTestResource(AzureStorageTestResource.class)
@QuarkusTestResource(AzureStorageTestResource.class)
class AzureStorageQueueTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.eclipse.microprofile.config.ConfigProvider;
Expand All @@ -38,7 +38,7 @@
import static org.hamcrest.Matchers.equalTo;

@QuarkusTest
@WithTestResource(value = CxfClientTestResource.class, restrictToAnnotatedClass = false)
@QuarkusTestResource(value = CxfClientTestResource.class)
class CxfSoapClientTest {

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.apache.camel.quarkus.component.cxf.soap.rest.it;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand All @@ -29,7 +29,7 @@
import org.junit.jupiter.api.Test;

@QuarkusTest
@WithTestResource(value = CxfRestTestResource.class, restrictToAnnotatedClass = false)
@QuarkusTestResource(value = CxfRestTestResource.class)
class CxfSoapRestTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.Properties;
import java.util.concurrent.TimeUnit;

import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.DisabledOnIntegrationTest;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
Expand All @@ -45,7 +45,7 @@
import static org.hamcrest.Matchers.equalTo;

@QuarkusTest
@WithTestResource(value = CxfWssClientTestResource.class, restrictToAnnotatedClass = false)
@QuarkusTestResource(value = CxfWssClientTestResource.class, restrictToAnnotatedClass = false)
class CxfSoapWssClientTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import javax.security.auth.callback.UnsupportedCallbackException;

import io.quarkiverse.cxf.test.QuarkusCxfClientTestUtil;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.apache.cxf.endpoint.Client;
Expand All @@ -42,7 +42,7 @@
import static io.quarkiverse.cxf.test.QuarkusCxfClientTestUtil.anyNs;

@QuarkusTest
@WithTestResource(value = CxfWssServerTestResource.class, restrictToAnnotatedClass = false)
@QuarkusTestResource(value = CxfWssServerTestResource.class)
class CxfSoapWssServerTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.stream.Collectors;

import com.github.tomakehurst.wiremock.WireMockServer;
import io.quarkus.test.common.WithTestResource;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
Expand All @@ -46,7 +46,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;

@QuarkusTest
@WithTestResource(LanguageTestResource.class)
@QuarkusTestResource(LanguageTestResource.class)
class LanguageTest {

@MockServer
Expand Down
Loading

0 comments on commit 8f2205b

Please sign in to comment.