@@ -96,4 +96,44 @@ describe('Multiple Kinesis Proxy Integrations Test', () => {
96
96
expect ( body ) . to . have . own . property ( 'ShardId' )
97
97
expect ( body ) . to . have . own . property ( 'SequenceNumber' )
98
98
} )
99
+
100
+ it ( 'should get correct response from kinesis proxy endpoints with action "PutRecord" with default partitionkey' , async ( ) => {
101
+ const stream = 'kinesis6'
102
+ const testEndpoint = `${ endpoint } /${ stream } `
103
+ const response = await fetch ( testEndpoint , {
104
+ method : 'POST' ,
105
+ headers : { 'Content-Type' : 'application/json' } ,
106
+ body : JSON . stringify ( { message : `data for stream ${ stream } ` } )
107
+ } )
108
+ expect ( response . headers . get ( 'access-control-allow-origin' ) ) . to . deep . equal ( '*' )
109
+ expect ( response . status ) . to . be . equal ( 200 )
110
+ const body = await response . json ( )
111
+ expect ( body ) . to . have . own . property ( 'ShardId' )
112
+ expect ( body ) . to . have . own . property ( 'SequenceNumber' )
113
+ } )
114
+
115
+ it ( 'should get correct response from kinesis proxy endpoints with action "PutRecords" with default partitionkey' , async ( ) => {
116
+ const stream = 'kinesis7'
117
+ const testEndpoint = `${ endpoint } /${ stream } `
118
+ const response = await fetch ( testEndpoint , {
119
+ method : 'POST' ,
120
+ headers : { 'Content-Type' : 'application/json' } ,
121
+ body : JSON . stringify ( {
122
+ records : [
123
+ { data : 'some data' , 'partition-key' : 'some key' } ,
124
+ { data : 'some other data' , 'partition-key' : 'some key' }
125
+ ]
126
+ } )
127
+ } )
128
+ expect ( response . headers . get ( 'access-control-allow-origin' ) ) . to . deep . equal ( '*' )
129
+ expect ( response . status ) . to . be . equal ( 200 )
130
+ const body = await response . json ( )
131
+ expect ( body ) . to . have . own . property ( 'FailedRecordCount' )
132
+ expect ( body ) . to . have . own . property ( 'Records' )
133
+ expect ( body . Records . length ) . to . be . equal ( 2 )
134
+ expect ( body . Records [ 0 ] ) . to . have . own . property ( 'ShardId' )
135
+ expect ( body . Records [ 0 ] ) . to . have . own . property ( 'SequenceNumber' )
136
+ expect ( body . Records [ 1 ] ) . to . have . own . property ( 'ShardId' )
137
+ expect ( body . Records [ 1 ] ) . to . have . own . property ( 'SequenceNumber' )
138
+ } )
99
139
} )
0 commit comments