@@ -64,6 +64,23 @@ func TestIntegrationSourceSpecValidation(t *testing.T) {
6464 },
6565 want : nil ,
6666 },
67+ {
68+ name : "valid AWS S3 source with service account and region" ,
69+ spec : IntegrationSourceSpec {
70+ Aws : & Aws {
71+ S3 : & v1alpha1.AWSS3 {
72+ AWSCommon : v1alpha1.AWSCommon {
73+ Region : "us-east-1" ,
74+ },
75+ Arn : "example-bucket" ,
76+ },
77+ Auth : & v1alpha1.Auth {
78+ ServiceAccountName : "aws-service-account" ,
79+ },
80+ },
81+ },
82+ want : nil ,
83+ },
6784 {
6885 name : "valid AWS SQS source with auth and region" ,
6986 spec : IntegrationSourceSpec {
@@ -85,6 +102,23 @@ func TestIntegrationSourceSpecValidation(t *testing.T) {
85102 },
86103 want : nil ,
87104 },
105+ {
106+ name : "valid AWS SQS source with service account and region" ,
107+ spec : IntegrationSourceSpec {
108+ Aws : & Aws {
109+ SQS : & v1alpha1.AWSSQS {
110+ AWSCommon : v1alpha1.AWSCommon {
111+ Region : "us-east-1" ,
112+ },
113+ Arn : "example-queue" ,
114+ },
115+ Auth : & v1alpha1.Auth {
116+ ServiceAccountName : "aws-service-account" ,
117+ },
118+ },
119+ },
120+ want : nil ,
121+ },
88122 {
89123 name : "valid AWS DDBStreams source with auth and region" ,
90124 spec : IntegrationSourceSpec {
@@ -106,6 +140,23 @@ func TestIntegrationSourceSpecValidation(t *testing.T) {
106140 },
107141 want : nil ,
108142 },
143+ {
144+ name : "valid AWS DDBStreams source with service account and region" ,
145+ spec : IntegrationSourceSpec {
146+ Aws : & Aws {
147+ DDBStreams : & v1alpha1.AWSDDBStreams {
148+ AWSCommon : v1alpha1.AWSCommon {
149+ Region : "us-east-1" ,
150+ },
151+ Table : "example-table" ,
152+ },
153+ Auth : & v1alpha1.Auth {
154+ ServiceAccountName : "aws-service-account" ,
155+ },
156+ },
157+ },
158+ want : nil ,
159+ },
109160 {
110161 name : "multiple sources set (invalid)" ,
111162 spec : IntegrationSourceSpec {
@@ -172,6 +223,35 @@ func TestIntegrationSourceSpecValidation(t *testing.T) {
172223 },
173224 want : apis .ErrMissingField ("aws.sqs.arn" ),
174225 },
226+ {
227+ name : "AWS SQS source without Auth (invalid)" ,
228+ spec : IntegrationSourceSpec {
229+ Aws : & Aws {
230+ SQS : & v1alpha1.AWSSQS {
231+ AWSCommon : v1alpha1.AWSCommon {
232+ Region : "us-east-1" ,
233+ },
234+ Arn : "example-queue" ,
235+ },
236+ },
237+ },
238+ want : apis .ErrMissingField ("aws.auth.secret.ref.name" ),
239+ },
240+ {
241+ name : "AWS SQS source without Auth credentials (invalid)" ,
242+ spec : IntegrationSourceSpec {
243+ Aws : & Aws {
244+ SQS : & v1alpha1.AWSSQS {
245+ AWSCommon : v1alpha1.AWSCommon {
246+ Region : "us-east-1" ,
247+ },
248+ Arn : "example-queue" ,
249+ },
250+ Auth : & v1alpha1.Auth {},
251+ },
252+ },
253+ want : apis .ErrMissingField ("aws.auth.secret.ref.name" ),
254+ },
175255 {
176256 name : "AWS DDBStreams source without Table (invalid)" ,
177257 spec : IntegrationSourceSpec {
0 commit comments