Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Outline

Feign APT test generator

This module generates mock clients for tests based on feign interfaces

Usage

Just need to add this module to dependency list and Java Annotation Processing Tool will automatically pick up the jar and generate test clients.

There are 2 main alternatives to include this to a project:

  1. Just add to classpath and java compiler should automaticaly detect and run code generation. On maven this is done like this:
        <dependency>
            <groupId>io.github.openfeign.experimental</groupId>
            <artifactId>feign-apt-test-generator</artifactId>
            <version>${feign.version}</version>
            <scope>test</scope>
        </dependency>
  1. Use a purpose build tool that allow to pick output location and don't mix dependencies onto classpath
            <plugin>
                <groupId>com.mysema.maven</groupId>
                <artifactId>apt-maven-plugin</artifactId>
                <version>1.1.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/generated-test-sources/feign</outputDirectory>
                            <processor>feign.apttestgenerator.GenerateTestStubAPT</processor>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>io.github.openfeign.experimental</groupId>
                        <artifactId>feign-apt-test-generator</artifactId>
                        <version>${feign.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>feign-stubs-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>target/generated-test-sources/feign</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.