A simple sample server using Swagger Inflector with Spring Boot.
This project integrates both Spring Boot Actuator and the Spring Boot Jersey integration. Because Actuator is built upon SpringMVC, Jersey and Actuator must listen on different end-points. Please see the applictaion.yaml
for how this is accomplished.
The project uses Gradle for its build system and you can build the project by running:
./gradlew build
You can also run the app using the Spring Boot Gradle Plugin like so:
./gradlew bootRun
The swagger definition will be available at the following URI:
http://localhost:8080/api/v2/swagger.json
The Spring Boot Actuator end-points are available here:
http://localhost:8080/info http://localhost:8080/env
You can create project files for Eclipse or IDEA by running:
./gradlew eclipse
or:
./gradlew idea
The project uses Cucumber with JUnit for testing. The feature files can be found in
src/test/resources/features
and the JUnit runners can be found in the io.swagger.samples.inflector.springboot.tests
package within src/test/java
. Each test class runs the features with different Spring profiles.
You can run them individually as JUnit tests in your IDE or you can run them all by running
./gradlew test
InflectorApplicationJavaApiH2LocalWsTests.java
tests the application with direct Java method calls. This ensures that the
functional logic is correctly implemented and is not coupled to the controllers, so that the same logic can be exposed
via other mechanisms in the future.
InflectorApplicationRestApiH2LocalWsTests.java
tests the application via REST calls. This ensures that the
functional logic is correctly exposed via the REST API, without changing that behaviour
Have fun!