@@ -42,31 +42,31 @@ func TestConfigure(t *testing.T) {
4242 }{
4343 {
4444 config : `
45- foobar: bla ` ,
46- expectedErr : "invalid configuration: listen_addr or listen_socket is required" ,
45+ timeout: 1m ` ,
46+ expectedErr : "listen_addr or listen_socket is required" ,
4747 },
4848 {
4949 config : `
5050source: http
5151listen_addr: 127.0.0.1:8080
5252path: wrongpath` ,
53- expectedErr : "invalid configuration: path must start with /" ,
53+ expectedErr : "path must start with /" ,
5454 },
5555 {
5656 config : `
5757source: http
5858listen_addr: 127.0.0.1:8080
5959path: /test
6060auth_type: basic_auth` ,
61- expectedErr : "invalid configuration: basic_auth is selected, but basic_auth is not provided" ,
61+ expectedErr : "basic_auth is selected, but basic_auth is not provided" ,
6262 },
6363 {
6464 config : `
6565source: http
6666listen_addr: 127.0.0.1:8080
6767path: /test
6868auth_type: headers` ,
69- expectedErr : "invalid configuration: headers is selected, but headers is not provided" ,
69+ expectedErr : "headers is selected, but headers is not provided" ,
7070 },
7171 {
7272 config : `
@@ -76,7 +76,7 @@ path: /test
7676auth_type: basic_auth
7777basic_auth:
7878 username: 132` ,
79- expectedErr : "invalid configuration: basic_auth is selected, but password is not provided" ,
79+ expectedErr : "basic_auth is selected, but password is not provided" ,
8080 },
8181 {
8282 config : `
@@ -86,7 +86,7 @@ path: /test
8686auth_type: basic_auth
8787basic_auth:
8888 password: 132` ,
89- expectedErr : "invalid configuration: basic_auth is selected, but username is not provided" ,
89+ expectedErr : "basic_auth is selected, but username is not provided" ,
9090 },
9191 {
9292 config : `
@@ -95,15 +95,15 @@ listen_addr: 127.0.0.1:8080
9595path: /test
9696auth_type: headers
9797headers:` ,
98- expectedErr : "invalid configuration: headers is selected, but headers is not provided" ,
98+ expectedErr : "headers is selected, but headers is not provided" ,
9999 },
100100 {
101101 config : `
102102source: http
103103listen_addr: 127.0.0.1:8080
104104path: /test
105105auth_type: toto` ,
106- expectedErr : "invalid configuration: invalid auth_type: must be one of basic_auth, headers, mtls" ,
106+ expectedErr : "invalid auth_type: must be one of basic_auth, headers, mtls" ,
107107 },
108108 {
109109 config : `
@@ -115,7 +115,7 @@ headers:
115115 key: value
116116tls:
117117 server_key: key` ,
118- expectedErr : "invalid configuration: server_cert is required" ,
118+ expectedErr : "server_cert is required" ,
119119 },
120120 {
121121 config : `
@@ -127,7 +127,7 @@ headers:
127127 key: value
128128tls:
129129 server_cert: cert` ,
130- expectedErr : "invalid configuration: server_key is required" ,
130+ expectedErr : "server_key is required" ,
131131 },
132132 {
133133 config : `
@@ -138,7 +138,7 @@ auth_type: mtls
138138tls:
139139 server_cert: cert
140140 server_key: key` ,
141- expectedErr : "invalid configuration: mtls is selected, but ca_cert is not provided" ,
141+ expectedErr : "mtls is selected, but ca_cert is not provided" ,
142142 },
143143 {
144144 config : `
@@ -149,7 +149,7 @@ auth_type: headers
149149headers:
150150 key: value
151151max_body_size: 0` ,
152- expectedErr : "invalid configuration: max_body_size must be positive" ,
152+ expectedErr : "max_body_size must be positive" ,
153153 },
154154 {
155155 config : `
@@ -160,7 +160,7 @@ auth_type: headers
160160headers:
161161 key: value
162162timeout: toto` ,
163- expectedErr : " cannot parse http datasource configuration: yaml: unmarshal errors: \n line 8: cannot unmarshal !!str ` toto` into time.Duration" ,
163+ expectedErr : ` cannot parse: time: invalid duration " toto"` ,
164164 },
165165 {
166166 config : `
@@ -171,7 +171,7 @@ auth_type: headers
171171headers:
172172 key: value
173173custom_status_code: 999` ,
174- expectedErr : "invalid configuration: invalid HTTP status code" ,
174+ expectedErr : "invalid HTTP status code" ,
175175 },
176176 }
177177
@@ -199,7 +199,7 @@ source: http
199199listen_addr: 127.0.0.1:8080
200200path: 15
201201 auth_type: headers` ))
202- cstest .AssertErrorMessage (t , err , "cannot parse http datasource configuration: yaml: line 4: found a tab character that violates indentation " )
202+ cstest .AssertErrorMessage (t , err , "cannot parse: [5:1] found character ' \t ' that cannot start any token " )
203203}
204204
205205func TestGetMode (t * testing.T ) {
0 commit comments