File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
kotlin-wot-integration-tests/src/test/kotlin/integration Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package integration
2+
3+ import ai.ancf.lmos.wot.Servient
4+ import ai.ancf.lmos.wot.Wot
5+ import ai.ancf.lmos.wot.binding.http.HttpProtocolClientFactory
6+ import ai.ancf.lmos.wot.binding.http.HttpsProtocolClientFactory
7+ import ai.ancf.lmos.wot.thing.schema.DataSchemaValue
8+ import kotlinx.coroutines.test.runTest
9+ import kotlin.test.Test
10+
11+ class TestSimpleCoffeeMachine {
12+
13+ @Test
14+ fun `Should fetch thing with HTTP` () = runTest {
15+ val http = HttpProtocolClientFactory ()
16+ val https = HttpsProtocolClientFactory ()
17+ val servient = Servient (clientFactories = listOf (http, https))
18+
19+ val wot = Wot .create(servient)
20+
21+ val thingDescription =
22+ wot.requestThingDescription(" https://zion.vaimee.com/things/urn:uuid:7ba2bca0-a7f6-47b3-bdce-498caa33bbaf" )
23+
24+ val coffeeMachine = wot.consume(thingDescription)
25+ val resources = coffeeMachine.readProperty(" resources" ).value() as DataSchemaValue .ObjectValue
26+
27+ println (resources)
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments