https://github.com/daggerok/resteasy-spring-boot-starter-example
Using RESTEasy Spring Boot starter integration. This is not just builtin Jersey integration!
https://github.com/daggerok/resteasy-spring-boot-starter-example
github-action github-action-docker github-actions github-actions-docker resteasy resteasy-spring-boot
Last synced: 28 days ago
JSON representation
Using RESTEasy Spring Boot starter integration. This is not just builtin Jersey integration!
- Host: GitHub
- URL: https://github.com/daggerok/resteasy-spring-boot-starter-example
- Owner: daggerok
- Created: 2020-04-27T21:50:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-27T22:30:36.000Z (over 5 years ago)
- Last Synced: 2025-02-27T02:20:34.548Z (10 months ago)
- Topics: github-action, github-action-docker, github-actions, github-actions-docker, resteasy, resteasy-spring-boot
- Language: Java
- Size: 54.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# resteasy-spring-boot-starter example [](https://github.com/daggerok/resteasy-spring-boot-starter-example/actions?query=workflow%3ACI)
Using RESTEasy Spring Boot starter integration. This is not just builtin Jersey integration!
_pom.xml_
```xml
org.jboss.resteasy
resteasy-spring-boot-starter
4.5.1.Final
```
_app_
```java
@SpringBootApplication
public class RESTEasySpringBootApplication {
@Component
@ApplicationPath("/api")
public static class RESTEasyConfig extends Application {
@Component
@Path("/hello")
@Produces(MediaType.APPLICATION_JSON)
public static class RESTEasyResource {
@GET
public Map hello() {
return Map.of("message", "Hello, World!");
}
}
}
public static void main(String[] args) {
SpringApplication.run(RESTEasySpringBootApplication.class, args);
}
}
```
_tests_
```java
@SpringBootTest
class RESTEasySpringBootApplicationTests {
@Autowired
WebTestClient webTestClient;
@Test
void contextLoads() {
webTestClient.get()
.uri("/api/hello")
.exchange()
.expectStatus().isOk()
.expectBody(new ParameterizedTypeReference>() {})
.consumeWith(mapEntityExchangeResult -> {
var map = mapEntityExchangeResult.getResponseBody();
assertThat(map.get("message")).isNotNull()
.isEqualToIgnoringCase("hello, world!");
});
}
}
```
_or simply_
```bash
./mvnw spring-boot:run
http :8080/api/hello
```
## resources
* https://www.youtube.com/watch?v=khzC-VwpFVM
* https://github.com/resteasy/resteasy-spring-boot/blob/master/mds/USAGE.md