Skip to content
This repository was archived by the owner on Aug 22, 2022. It is now read-only.

Commit 15a5c32

Browse files
committed
feat(serialization): add lex v2 event test
1 parent b686a3e commit 15a5c32

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed

aws-lambda-java-serialization/src/test/java/com/amazonaws/services/lambda/runtime/serialization/events/LambdaEventSerializersTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ public void testLexEvent() throws IOException {
158158
assertJsonEqual(expected, actual);
159159
}
160160

161+
@Test
162+
public void testLexV2Event() throws IOException {
163+
String expected = readEvent("lex_v2_event.json");
164+
String actual = deserializeSerializeJsonToString(expected, LexV2Event.class);
165+
166+
assertJsonEqual(expected, actual);
167+
}
168+
161169
@Test
162170
public void testS3Event() throws IOException {
163171
String expected = readEvent("s3_event.json");
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"sessionId": "123456789123456",
3+
"inputTranscript": "deluxe",
4+
"interpretations": [
5+
{
6+
"intent": {
7+
"slots": {
8+
"RoomType": {
9+
"shape": "Scalar",
10+
"value": {
11+
"originalValue": "deluxe",
12+
"resolvedValues": [
13+
"deluxe"
14+
],
15+
"interpretedValue": "deluxe"
16+
}
17+
},
18+
"CheckInDate": {
19+
"shape": "Scalar",
20+
"value": {
21+
"originalValue": "fifth of may",
22+
"resolvedValues": [
23+
"2022-05-05"
24+
],
25+
"interpretedValue": "2022-05-05"
26+
}
27+
},
28+
"Nights": {
29+
"shape": "Scalar",
30+
"value": {
31+
"originalValue": "fourteen",
32+
"resolvedValues": [
33+
"14"
34+
],
35+
"interpretedValue": "14"
36+
}
37+
},
38+
"Location": {
39+
"shape": "Scalar",
40+
"value": {
41+
"originalValue": "seattle",
42+
"resolvedValues": [
43+
"seattle"
44+
],
45+
"interpretedValue": "seattle"
46+
}
47+
}
48+
},
49+
"confirmationState": "None",
50+
"name": "BookHotel",
51+
"state": "InProgress"
52+
},
53+
"nluConfidence": 1
54+
},
55+
{
56+
"intent": {
57+
"slots": {},
58+
"confirmationState": "None",
59+
"name": "FallbackIntent",
60+
"state": "InProgress"
61+
}
62+
},
63+
{
64+
"intent": {
65+
"slots": {
66+
"ReturnDate": null,
67+
"PickUpDate": null,
68+
"DriverAge": null,
69+
"CarType": null,
70+
"PickUpCity": null
71+
},
72+
"confirmationState": "None",
73+
"name": "BookCar",
74+
"state": "InProgress"
75+
},
76+
"nluConfidence": 0.52
77+
}
78+
],
79+
"responseContentType": "text/plain; charset=utf-8",
80+
"invocationSource": "DialogCodeHook",
81+
"messageVersion": "1.0",
82+
"sessionState": {
83+
"originatingRequestId": "00000000-1111-2222-3333-444444444444",
84+
"activeContexts": [],
85+
"intent": {
86+
"slots": {
87+
"RoomType": {
88+
"shape": "Scalar",
89+
"value": {
90+
"originalValue": "deluxe",
91+
"resolvedValues": [
92+
"deluxe"
93+
],
94+
"interpretedValue": "deluxe"
95+
}
96+
},
97+
"CheckInDate": {
98+
"shape": "Scalar",
99+
"value": {
100+
"originalValue": "fifth of may",
101+
"resolvedValues": [
102+
"2022-05-05"
103+
],
104+
"interpretedValue": "2022-05-05"
105+
}
106+
},
107+
"Nights": {
108+
"shape": "Scalar",
109+
"value": {
110+
"originalValue": "fourteen",
111+
"resolvedValues": [
112+
"14"
113+
],
114+
"interpretedValue": "14"
115+
}
116+
},
117+
"Location": {
118+
"shape": "Scalar",
119+
"value": {
120+
"originalValue": "seattle",
121+
"resolvedValues": [
122+
"seattle"
123+
],
124+
"interpretedValue": "seattle"
125+
}
126+
}
127+
},
128+
"confirmationState": "None",
129+
"name": "BookHotel",
130+
"state": "InProgress"
131+
}
132+
},
133+
"inputMode": "Text",
134+
"bot": {
135+
"aliasName": "TestBotAlias",
136+
"aliasId": "TSTALIASID",
137+
"name": "BookTrip",
138+
"version": "DRAFT",
139+
"localeId": "en_US",
140+
"id": "ABCDE01235"
141+
}
142+
}

0 commit comments

Comments
 (0)