Spring Rest Docs AMQP

Spring Rest Docs AMQP is extension for Spring Rest Docs and Spring Cloud Contract to generate snippet files from Contract.

License

License

GroupId

GroupId

com.ascendcorp
ArtifactId

ArtifactId

spring-restdocs-amqp
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Spring Rest Docs AMQP
Spring Rest Docs AMQP is extension for Spring Rest Docs and Spring Cloud Contract to generate snippet files from Contract.
Project URL

Project URL

https://github.com/ascendcorp/spring-restdocs-amqp
Source Code Management

Source Code Management

https://github.com/ascendcorp/spring-restdocs-amqp/tree/master

Download spring-restdocs-amqp

How to add to project

<!-- https://jarcasting.com/artifacts/com.ascendcorp/spring-restdocs-amqp/ -->
<dependency>
    <groupId>com.ascendcorp</groupId>
    <artifactId>spring-restdocs-amqp</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.ascendcorp/spring-restdocs-amqp/
implementation 'com.ascendcorp:spring-restdocs-amqp:1.0.0'
// https://jarcasting.com/artifacts/com.ascendcorp/spring-restdocs-amqp/
implementation ("com.ascendcorp:spring-restdocs-amqp:1.0.0")
'com.ascendcorp:spring-restdocs-amqp:jar:1.0.0'
<dependency org="com.ascendcorp" name="spring-restdocs-amqp" rev="1.0.0">
  <artifact name="spring-restdocs-amqp" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.ascendcorp', module='spring-restdocs-amqp', version='1.0.0')
)
libraryDependencies += "com.ascendcorp" % "spring-restdocs-amqp" % "1.0.0"
[com.ascendcorp/spring-restdocs-amqp "1.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-amqp jar 2.1.1.RELEASE
org.springframework.restdocs : spring-restdocs-core jar 2.0.2.RELEASE
org.mockito : mockito-core jar 2.23.4

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Spring Rest Docs AMQP

Apache 2.0

Spring Rest Docs AMQP is extension for Spring Rest Docs and Spring Cloud Contract to generate snippet files from Contract, and we don't want repeat our self steps to manual create document specification of message schema.

This way, the message schema (snippet) is generated from Spring Cloud Contract testing in Aciidoctor format, and you can compile it to beautiful HTML or PDF document.

Pre-Requisite

Your application implement Spring Cloud Contract with stub AMQP message configure.

Add test dependency

<dependency>
    <groupId>com.ascendcorp</groupId>
    <artifactId>spring-restdocs-amqp</artifactId>
    <version>1.0.0</version>
    <scope>test</scope>
</dependency>

Bind message processor

Initial AMQP message post processor and bind with RabbitTemplate in contract test base class

@Rule
public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("target/generated-snippets");

@Autowired
RabbitTemplate rabbitTemplate;

@Rule
public TestName testName = new TestName();
``
@Before
public void setup() {
    String testName = this.testName.getMethodName();

    AmqpMessagePostProcessor amqpMessagePostProcessor = new AmqpMessagePostProcessor(testName, restDocumentation, rabbitTemplate);
    rabbitTemplate.setBeforePublishPostProcessors(amqpMessagePostProcessor);
}

After run contract testing, the snippet file will be generated to target/generated-snippets/{methodName} folder


Licensed under Apache Software License 2.0

com.ascendcorp

Ascendcorp

Versions

Version
1.0.0