@@ -18,9 +18,10 @@ package v1alpha1
18
18
19
19
import (
20
20
"context"
21
- "knative.dev/eventing/pkg/apis/common"
22
21
"testing"
23
22
23
+ "knative.dev/eventing/pkg/apis/common/integration/v1alpha1"
24
+
24
25
"github.com/google/go-cmp/cmp"
25
26
"knative.dev/pkg/apis"
26
27
)
@@ -45,15 +46,15 @@ func TestIntegrationSinkSpecValidation(t *testing.T) {
45
46
name : "valid AWS S3 sink with auth and region" ,
46
47
spec : IntegrationSinkSpec {
47
48
Aws : & Aws {
48
- S3 : & common .AWSS3 {
49
- AWSCommon : common .AWSCommon {
49
+ S3 : & v1alpha1 .AWSS3 {
50
+ AWSCommon : v1alpha1 .AWSCommon {
50
51
Region : "us-east-1" ,
51
52
},
52
- BucketNameOrArn : "example-bucket" ,
53
+ Arn : "example-bucket" ,
53
54
},
54
- Auth : & common .Auth {
55
- Secret : & common .Secret {
56
- Ref : & common .SecretReference {
55
+ Auth : & v1alpha1 .Auth {
56
+ Secret : & v1alpha1 .Secret {
57
+ Ref : & v1alpha1 .SecretReference {
57
58
Name : "aws-secret" ,
58
59
},
59
60
},
@@ -66,15 +67,15 @@ func TestIntegrationSinkSpecValidation(t *testing.T) {
66
67
name : "valid AWS SQS sink with auth and region" ,
67
68
spec : IntegrationSinkSpec {
68
69
Aws : & Aws {
69
- SQS : & common .AWSSQS {
70
- AWSCommon : common .AWSCommon {
70
+ SQS : & v1alpha1 .AWSSQS {
71
+ AWSCommon : v1alpha1 .AWSCommon {
71
72
Region : "us-east-1" ,
72
73
},
73
- QueueNameOrArn : "example-queue" ,
74
+ Arn : "example-queue" ,
74
75
},
75
- Auth : & common .Auth {
76
- Secret : & common .Secret {
77
- Ref : & common .SecretReference {
76
+ Auth : & v1alpha1 .Auth {
77
+ Secret : & v1alpha1 .Secret {
78
+ Ref : & v1alpha1 .SecretReference {
78
79
Name : "aws-secret" ,
79
80
},
80
81
},
@@ -91,11 +92,11 @@ func TestIntegrationSinkSpecValidation(t *testing.T) {
91
92
ShowHeaders : true ,
92
93
},
93
94
Aws : & Aws {
94
- S3 : & common .AWSS3 {
95
- AWSCommon : common .AWSCommon {
95
+ S3 : & v1alpha1 .AWSS3 {
96
+ AWSCommon : v1alpha1 .AWSCommon {
96
97
Region : "us-east-1" ,
97
98
},
98
- BucketNameOrArn : "example-bucket" ,
99
+ Arn : "example-bucket" ,
99
100
},
100
101
},
101
102
},
@@ -105,21 +106,21 @@ func TestIntegrationSinkSpecValidation(t *testing.T) {
105
106
name : "multiple AWS sinks set (invalid)" ,
106
107
spec : IntegrationSinkSpec {
107
108
Aws : & Aws {
108
- S3 : & common .AWSS3 {
109
- AWSCommon : common .AWSCommon {
109
+ S3 : & v1alpha1 .AWSS3 {
110
+ AWSCommon : v1alpha1 .AWSCommon {
110
111
Region : "us-east-1" ,
111
112
},
112
- BucketNameOrArn : "example-bucket" ,
113
+ Arn : "example-bucket" ,
113
114
},
114
- SQS : & common .AWSSQS {
115
- AWSCommon : common .AWSCommon {
115
+ SQS : & v1alpha1 .AWSSQS {
116
+ AWSCommon : v1alpha1 .AWSCommon {
116
117
Region : "us-east-1" ,
117
118
},
118
- QueueNameOrArn : "example-queue" ,
119
+ Arn : "example-queue" ,
119
120
},
120
- Auth : & common .Auth {
121
- Secret : & common .Secret {
122
- Ref : & common .SecretReference {
121
+ Auth : & v1alpha1 .Auth {
122
+ Secret : & v1alpha1 .Secret {
123
+ Ref : & v1alpha1 .SecretReference {
123
124
Name : "aws-secret" ,
124
125
},
125
126
},
@@ -132,14 +133,14 @@ func TestIntegrationSinkSpecValidation(t *testing.T) {
132
133
name : "AWS SQS sink without QueueNameOrArn (invalid)" ,
133
134
spec : IntegrationSinkSpec {
134
135
Aws : & Aws {
135
- SQS : & common .AWSSQS {
136
- AWSCommon : common .AWSCommon {
136
+ SQS : & v1alpha1 .AWSSQS {
137
+ AWSCommon : v1alpha1 .AWSCommon {
137
138
Region : "us-east-1" ,
138
139
},
139
140
},
140
- Auth : & common .Auth {
141
- Secret : & common .Secret {
142
- Ref : & common .SecretReference {
141
+ Auth : & v1alpha1 .Auth {
142
+ Secret : & v1alpha1 .Secret {
143
+ Ref : & v1alpha1 .SecretReference {
143
144
Name : "aws-secret" ,
144
145
},
145
146
},
@@ -157,11 +158,11 @@ func TestIntegrationSinkSpecValidation(t *testing.T) {
157
158
name : "AWS sink without auth (invalid)" ,
158
159
spec : IntegrationSinkSpec {
159
160
Aws : & Aws {
160
- S3 : & common .AWSS3 {
161
- AWSCommon : common .AWSCommon {
161
+ S3 : & v1alpha1 .AWSS3 {
162
+ AWSCommon : v1alpha1 .AWSCommon {
162
163
Region : "us-east-1" ,
163
164
},
164
- BucketNameOrArn : "example-bucket" ,
165
+ Arn : "example-bucket" ,
165
166
},
166
167
},
167
168
},
@@ -171,12 +172,12 @@ func TestIntegrationSinkSpecValidation(t *testing.T) {
171
172
name : "AWS S3 sink without region (invalid)" ,
172
173
spec : IntegrationSinkSpec {
173
174
Aws : & Aws {
174
- S3 : & common .AWSS3 {
175
- BucketNameOrArn : "example-bucket" ,
175
+ S3 : & v1alpha1 .AWSS3 {
176
+ Arn : "example-bucket" ,
176
177
},
177
- Auth : & common .Auth {
178
- Secret : & common .Secret {
179
- Ref : & common .SecretReference {
178
+ Auth : & v1alpha1 .Auth {
179
+ Secret : & v1alpha1 .Secret {
180
+ Ref : & v1alpha1 .SecretReference {
180
181
Name : "aws-secret" ,
181
182
},
182
183
},
0 commit comments