Skip to content

Commit

Permalink
Merge pull request #79 from Apicurio/quarkus-extension-integration-tests
Browse files Browse the repository at this point in the history
Add integration tests for the quarkus extension
  • Loading branch information
carlesarnal authored Dec 1, 2022
2 parents 2f79218 + d66ef1a commit cac8172
Show file tree
Hide file tree
Showing 8 changed files with 1,439 additions and 4 deletions.
2 changes: 1 addition & 1 deletion quarkus-extension/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>apicurio-codegen-quarkus-extension-parent</artifactId>
<groupId>io.apicurio</groupId>
<version>1.0.13-SNAPSHOT</version>
<version>999-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
106 changes: 106 additions & 0 deletions quarkus-extension/integration-tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apicurio-codegen-quarkus-extension-parent</artifactId>
<groupId>io.apicurio</groupId>
<version>999-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>apicurio-codegen-quarkus-extension-integration-tests</artifactId>

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-undertow</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-codegen-quarkus-extension</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-common</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
<maven.repo>${settings.localRepository}</maven.repo>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${failsafe-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
<maven.repo>${settings.localRepository}</maven.repo>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package io.petstore;

import io.petstore.beans.ApiResponse;
import io.petstore.beans.Pet;

import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PetStoreImpl implements PetResource {

private static final Map<Long, Pet> PETS = new HashMap<>();

@Override
public Pet updatePet(Pet data) {
return PETS.put(data.getId(), data);
}

@Override
public Pet addPet(Pet data) {
return PETS.put(data.getId(), data);
}

@Override
public List<Pet> findPetsByStatus(String status) {
return null;
}

@Override
public List<Pet> findPetsByTags(List<String> tags) {
return null;
}

@Override
public Pet getPetById(long petId) {
return PETS.get(petId);
}

@Override
public void updatePetWithForm(long petId, String name, String status) {

}

@Override
public void deletePet(String apiKey, long petId) {
PETS.remove(petId);
}

@Override
public ApiResponse uploadFile(long petId, String additionalMetadata, InputStream data) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Codegen properties
apicurio.codegen.openapi.spec=openapi.json
apicurio.codegen.openapi.base-package=io.petstore
Loading

0 comments on commit cac8172

Please sign in to comment.