@@ -16,32 +16,39 @@ func TestAccGithubRepositoryAutolinkReference(t *testing.T) {
16
16
17
17
config := fmt .Sprintf (`
18
18
resource "github_repository" "test" {
19
- name = "test-%s"
20
- description = "Test autolink creation"
19
+ name = "test-%s"
20
+ description = "Test autolink creation"
21
21
}
22
22
23
23
resource "github_repository_autolink_reference" "autolink_default" {
24
24
repository = github_repository.test.name
25
25
26
- key_prefix = "TEST1-"
26
+ key_prefix = "TEST1-"
27
27
target_url_template = "https://example.com/TEST-<num>"
28
28
}
29
29
30
30
resource "github_repository_autolink_reference" "autolink_alphanumeric" {
31
31
repository = github_repository.test.name
32
32
33
- key_prefix = "TEST2-"
33
+ key_prefix = "TEST2-"
34
34
target_url_template = "https://example.com/TEST-<num>"
35
35
is_alphanumeric = true
36
36
}
37
37
38
38
resource "github_repository_autolink_reference" "autolink_numeric" {
39
39
repository = github_repository.test.name
40
40
41
- key_prefix = "TEST3-"
41
+ key_prefix = "TEST3-"
42
42
target_url_template = "https://example.com/TEST-<num>"
43
43
is_alphanumeric = false
44
44
}
45
+
46
+ resource "github_repository_autolink_reference" "autolink_with_port" {
47
+ repository = github_repository.test.name
48
+
49
+ key_prefix = "TEST4-"
50
+ target_url_template = "https://example.com:8443/TEST-<num>"
51
+ }
45
52
` , randomID )
46
53
47
54
check := resource .ComposeTestCheckFunc (
@@ -75,6 +82,16 @@ func TestAccGithubRepositoryAutolinkReference(t *testing.T) {
75
82
resource .TestCheckResourceAttr (
76
83
"github_repository_autolink_reference.autolink_numeric" , "is_alphanumeric" , "false" ,
77
84
),
85
+ // autolink_with_port
86
+ resource .TestCheckResourceAttr (
87
+ "github_repository_autolink_reference.autolink_with_port" , "key_prefix" , "TEST4-" ,
88
+ ),
89
+ resource .TestCheckResourceAttr (
90
+ "github_repository_autolink_reference.autolink_with_port" , "target_url_template" , "https://example.com:8443/TEST-<num>" ,
91
+ ),
92
+ resource .TestCheckResourceAttr (
93
+ "github_repository_autolink_reference.autolink_with_port" , "is_alphanumeric" , "true" ,
94
+ ),
78
95
)
79
96
80
97
testCase := func (t * testing.T , mode string ) {
@@ -108,32 +125,39 @@ func TestAccGithubRepositoryAutolinkReference(t *testing.T) {
108
125
109
126
config := fmt .Sprintf (`
110
127
resource "github_repository" "test" {
111
- name = "test-%s"
112
- description = "Test autolink creation"
128
+ name = "test-%s"
129
+ description = "Test autolink creation"
113
130
}
114
131
115
132
resource "github_repository_autolink_reference" "autolink_default" {
116
133
repository = github_repository.test.name
117
134
118
- key_prefix = "TEST1-"
135
+ key_prefix = "TEST1-"
119
136
target_url_template = "https://example.com/TEST-<num>"
120
137
}
121
138
122
139
resource "github_repository_autolink_reference" "autolink_alphanumeric" {
123
140
repository = github_repository.test.name
124
141
125
- key_prefix = "TEST2-"
142
+ key_prefix = "TEST2-"
126
143
target_url_template = "https://example.com/TEST-<num>"
127
144
is_alphanumeric = true
128
145
}
129
146
130
147
resource "github_repository_autolink_reference" "autolink_numeric" {
131
148
repository = github_repository.test.name
132
149
133
- key_prefix = "TEST3-"
150
+ key_prefix = "TEST3-"
134
151
target_url_template = "https://example.com/TEST-<num>"
135
152
is_alphanumeric = false
136
153
}
154
+
155
+ resource "github_repository_autolink_reference" "autolink_with_port" {
156
+ repository = github_repository.test.name
157
+
158
+ key_prefix = "TEST4-"
159
+ target_url_template = "https://example.com:8443/TEST-<num>"
160
+ }
137
161
` , randomID )
138
162
139
163
check := resource .ComposeTestCheckFunc (
@@ -167,6 +191,16 @@ func TestAccGithubRepositoryAutolinkReference(t *testing.T) {
167
191
resource .TestCheckResourceAttr (
168
192
"github_repository_autolink_reference.autolink_numeric" , "is_alphanumeric" , "false" ,
169
193
),
194
+ // autolink_with_port
195
+ resource .TestCheckResourceAttr (
196
+ "github_repository_autolink_reference.autolink_with_port" , "key_prefix" , "TEST4-" ,
197
+ ),
198
+ resource .TestCheckResourceAttr (
199
+ "github_repository_autolink_reference.autolink_with_port" , "target_url_template" , "https://example.com:8443/TEST-<num>" ,
200
+ ),
201
+ resource .TestCheckResourceAttr (
202
+ "github_repository_autolink_reference.autolink_with_port" , "is_alphanumeric" , "true" ,
203
+ ),
170
204
)
171
205
172
206
testCase := func (t * testing.T , mode string ) {
@@ -199,6 +233,13 @@ func TestAccGithubRepositoryAutolinkReference(t *testing.T) {
199
233
ImportStateVerify : true ,
200
234
ImportStateIdPrefix : fmt .Sprintf ("test-%s/" , randomID ),
201
235
},
236
+ // autolink_with_port
237
+ {
238
+ ResourceName : "github_repository_autolink_reference.autolink_with_port" ,
239
+ ImportState : true ,
240
+ ImportStateVerify : true ,
241
+ ImportStateIdPrefix : fmt .Sprintf ("test-%s/" , randomID ),
242
+ },
202
243
},
203
244
})
204
245
}
@@ -221,14 +262,14 @@ func TestAccGithubRepositoryAutolinkReference(t *testing.T) {
221
262
222
263
config := fmt .Sprintf (`
223
264
resource "github_repository" "test" {
224
- name = "test-%s"
225
- description = "Test autolink creation"
265
+ name = "test-%s"
266
+ description = "Test autolink creation"
226
267
}
227
268
228
269
resource "github_repository_autolink_reference" "autolink_default" {
229
270
repository = github_repository.test.name
230
271
231
- key_prefix = "TEST1-"
272
+ key_prefix = "TEST1-"
232
273
target_url_template = "https://example.com/TEST-<num>"
233
274
}
234
275
` , randomID )
0 commit comments