Spring 5 Kotlin REST API demo with Spring Boot 2 stacks. This project is consist of CRUD Web endpoint.
- Java8 (JDK 8 update 171)
- Kotlin 1.2.70
- Spring Boot 2.0.5
- Gradle 4.8.1
- H2DB
- Undertow Web Server
- Jacoco
gradlew clean build
Find the built result at /build/libs/spring-kotlin-api-1.0.0.jar
# run all test
gradlew test
# run coverage test report
gradlew jacocoTestReport
Find the test result report at /build/reports/test/
for test result, and /build/reports/jacoco
for Jacoco coverage test result report.
gradlew bootRun
Access from local url: http://localhost:8080
Test the REST API locally with Curl or alternatively you can use Insomnia Web API Test, feel free to download my Insomnia Workspace at Here and import into yours.
HTTP Method | Path | Description |
---|---|---|
GET | /api/customer | Get all existing customer data. |
GET | /api/customer/{id} | Get existing customer data by Id. |
POST | /api/customer | Insert new customer data. |
PUT | /api/customer/{id} | update existing customer data by Id. |
DELETE | /api/customer/{id} | Delete existing customer data by Id. |
- Spring Boot and Kotlin
- Creating a RESTful Web Service with Spring Boot
- Building Restful APIs with Kotlin, Spring Boot, Mysql, JPA and Hibernate
- Creating and Testing a Kotlin RESTful Web Services using Spring Boot
- More readable tests with Kotlin
- Test coverage in Kotlin with Jacoco
- Codecov Kotlin Example
Copyright 2018 Maikel Chandika ([email protected]). Code released under the MIT License. See LICENSE file.