@@ -5,10 +5,11 @@ import (
5
5
"strings"
6
6
"testing"
7
7
8
- "github.com/alexkappa/terraform-provider-auth0/auth0/internal/random"
9
8
"github.com/hashicorp/go-multierror"
10
9
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
11
10
"github.com/hashicorp/terraform-plugin-sdk/terraform"
11
+
12
+ "github.com/alexkappa/terraform-provider-auth0/auth0/internal/random"
12
13
)
13
14
14
15
func init () {
@@ -61,7 +62,7 @@ func TestAccLogStreamHTTP(t *testing.T) {
61
62
),
62
63
},
63
64
{
64
- Config : random .Template (testAccLogStreamHTTPConfigUpdateFormat , rand ),
65
+ Config : random .Template (testAccLogStreamHTTPConfigUpdateFormatToJSONARRAY , rand ),
65
66
Check : resource .ComposeTestCheckFunc (
66
67
random .TestCheckResourceAttr ("auth0_log_stream.my_log_stream" , "name" , "Acceptance-Test-LogStream-http-{{.random}}" , rand ),
67
68
resource .TestCheckResourceAttr ("auth0_log_stream.my_log_stream" , "type" , "http" ),
@@ -72,7 +73,7 @@ func TestAccLogStreamHTTP(t *testing.T) {
72
73
),
73
74
},
74
75
{
75
- Config : random .Template (testAccLogStreamHTTPConfigUpdateJsonObject , rand ),
76
+ Config : random .Template (testAccLogStreamHTTPConfigUpdateFormatToJSONOBJECT , rand ),
76
77
Check : resource .ComposeTestCheckFunc (
77
78
random .TestCheckResourceAttr ("auth0_log_stream.my_log_stream" , "name" , "Acceptance-Test-LogStream-http-{{.random}}" , rand ),
78
79
resource .TestCheckResourceAttr ("auth0_log_stream.my_log_stream" , "type" , "http" ),
@@ -110,38 +111,41 @@ resource "auth0_log_stream" "my_log_stream" {
110
111
}
111
112
}
112
113
`
113
- const testAccLogStreamHTTPConfigUpdate = `
114
+
115
+ const testAccLogStreamHTTPConfigUpdateFormatToJSONARRAY = `
114
116
resource "auth0_log_stream" "my_log_stream" {
115
- name = "Acceptance-Test-LogStream-http-new- {{.random}}"
117
+ name = "Acceptance-Test-LogStream-http-{{.random}}"
116
118
type = "http"
117
119
sink {
118
- http_endpoint = "https://example.com/logs"
119
- http_content_type = "application/json"
120
- http_content_format = "JSONLINES "
120
+ http_endpoint = "https://example.com/webhook/ logs"
121
+ http_content_type = "application/json; charset=utf-8 "
122
+ http_content_format = "JSONARRAY "
121
123
http_authorization = "AKIAXXXXXXXXXXXXXXXX"
122
124
}
123
125
}
124
126
`
125
- const testAccLogStreamHTTPConfigUpdateJsonObject = `
127
+
128
+ const testAccLogStreamHTTPConfigUpdateFormatToJSONOBJECT = `
126
129
resource "auth0_log_stream" "my_log_stream" {
127
- name = "Acceptance-Test-LogStream-http-new- {{.random}}"
130
+ name = "Acceptance-Test-LogStream-http-{{.random}}"
128
131
type = "http"
129
132
sink {
130
- http_endpoint = "https://example.com/logs"
131
- http_content_type = "application/json"
133
+ http_endpoint = "https://example.com/webhook/ logs"
134
+ http_content_type = "application/json; charset=utf-8 "
132
135
http_content_format = "JSONOBJECT"
133
136
http_authorization = "AKIAXXXXXXXXXXXXXXXX"
134
137
}
135
138
}
136
139
`
137
- const testAccLogStreamHTTPConfigUpdateFormat = `
140
+
141
+ const testAccLogStreamHTTPConfigUpdate = `
138
142
resource "auth0_log_stream" "my_log_stream" {
139
- name = "Acceptance-Test-LogStream-http-{{.random}}"
143
+ name = "Acceptance-Test-LogStream-http-new- {{.random}}"
140
144
type = "http"
141
145
sink {
142
- http_endpoint = "https://example.com/webhook/ logs"
143
- http_content_type = "application/json; charset=utf-8 "
144
- http_content_format = "JSONARRAY "
146
+ http_endpoint = "https://example.com/logs"
147
+ http_content_type = "application/json"
148
+ http_content_format = "JSONLINES "
145
149
http_authorization = "AKIAXXXXXXXXXXXXXXXX"
146
150
}
147
151
}
@@ -217,7 +221,7 @@ resource "auth0_log_stream" "my_log_stream" {
217
221
}
218
222
`
219
223
220
- //This test fails it subscription key is not valid, or Eventgrid Resource Provider is not registered in the subscription
224
+ // This test fails it subscription key is not valid, or Eventgrid Resource Provider is not registered in the subscription
221
225
func TestAccLogStreamEventGrid (t * testing.T ) {
222
226
rand := random .String (6 )
223
227
0 commit comments