在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):LearningByExample/KotlinReactiveMS开源软件地址(OpenSource Url):https://github.com/LearningByExample/KotlinReactiveMS开源编程语言(OpenSource Language):Kotlin 80.7%开源软件介绍(OpenSource Introduction):Kotlin Reactive Micro Services ExampleIntelliJ code coverage runner gives a 100%, unfortunately I've not managed to get the same results using codecov.io and JaCoCo infoThis is an example of doing reactive MicroServices using spring 5 functional web framework and spring boot 2 using Kotlin. This is a fork of the original java version. This service provide and API that will get the geo location and the sunrise and sunset times from an address. Scenario: Get Location
Given I've an address
When I call the location service
Then I should get a geo location
And I should get the sunrise and sunset times To implement this example we consume a couple of REST APIs. This example cover several topics:
Includes and in depth look to testing using JUnit5:
Sample requestsGet from address $ curl -X GET "http://localhost:8080/api/location/Trafalgar%20Square%2C%20London%2C%20England" -H "accept: application/json" Post from JSON $ curl -X POST "http://localhost:8080/api/location" -H "accept: application/json" -H "content-type: application/json" -d "{ \"address\": \"Trafalgar Square, London, England\"}" Both will produce something like: {
"geographicCoordinates": {
"latitude": 51.508039,
"longitude": -0.128069
},
"sunriseSunset": {
"sunrise": "2017-05-21T03:59:08+00:00",
"sunset": "2017-05-21T19:55:11+00:00"
}
} All date and times are ISO 8601 UTC without summer time adjustment APIView in the embedded Swagger UI Project Structure
References
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论