diff options
Diffstat (limited to 'src/server_test.go')
| -rw-r--r-- | src/server_test.go | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/server_test.go b/src/server_test.go index 3045983..6199884 100644 --- a/src/server_test.go +++ b/src/server_test.go @@ -35,13 +35,10 @@ func LoginOAuthSelenium(t *testing.T, url string) { } } -func StateCallback(t *testing.T, oldState string, newState string, data string) string { +func StateCallback(t *testing.T, oldState string, newState string, data string) { if newState == "OAuth_Started" { go LoginOAuthSelenium(t, data) } - - // We have no data to send back - return "" } func Test_server(t *testing.T) { @@ -50,8 +47,8 @@ func Test_server(t *testing.T) { // Do not verify because during testing, the cert is self-signed http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} - state.Register("org.eduvpn.app.linux", "configstest", func(old string, new string, data string) string { - return StateCallback(t, old, new, data) + state.Register("org.eduvpn.app.linux", "configstest", func(old string, new string, data string) { + StateCallback(t, old, new, data) }, false) _, configErr := state.Connect("https://eduvpnserver") @@ -68,7 +65,7 @@ func test_connect_oauth_parameter(t *testing.T, parameters URLParameters, expect // Do not verify because during testing, the cert is self-signed http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} - state.Register("org.eduvpn.app.linux", "configsnologin", func(oldState string, newState string, data string) string { + state.Register("org.eduvpn.app.linux", "configsnologin", func(oldState string, newState string, data string) { if newState == "OAuth_Started" { baseURL := "http://127.0.0.1:8000/callback" url, err := HTTPConstructURL(baseURL, parameters) @@ -78,8 +75,6 @@ func test_connect_oauth_parameter(t *testing.T, parameters URLParameters, expect go http.Get(url) } - // We have no data to send back - return "" }, false) _, configErr := state.Connect("https://eduvpnserver") @@ -129,8 +124,8 @@ func Test_token_expired(t *testing.T) { // Do not verify because during testing, the cert is self-signed http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} - state.Register("org.eduvpn.app.linux", "configsexpired", func(old string, new string, data string) string { - return StateCallback(t, old, new, data) + state.Register("org.eduvpn.app.linux", "configsexpired", func(old string, new string, data string) { + StateCallback(t, old, new, data) }, false) _, configErr := state.Connect("https://eduvpnserver") |
