@@ -12,32 +12,10 @@ import (
1212 "testing"
1313 "time"
1414
15+ "github.com/dexidp/dex/server/device"
1516 "github.com/dexidp/dex/storage"
1617)
1718
18- func TestDeviceVerificationURI (t * testing.T ) {
19- t0 := time .Now ()
20-
21- now := func () time.Time { return t0 }
22- // Setup a dex server.
23- httpServer , s := newTestServer (t , func (c * Config ) {
24- c .Issuer += "/non-root-path"
25- c .Now = now
26- })
27- defer httpServer .Close ()
28-
29- u , err := url .Parse (s .issuerURL .String ())
30- if err != nil {
31- t .Fatalf ("Could not parse issuer URL %v" , err )
32- }
33- u .Path = path .Join (u .Path , "/device/auth/verify_code" )
34-
35- uri := s .getDeviceVerificationURI ()
36- if uri != u .Path {
37- t .Errorf ("Invalid verification URI. Expected %v got %v" , u .Path , uri )
38- }
39- }
40-
4119func TestHandleDeviceCode (t * testing.T ) {
4220 t0 := time .Now ()
4321
@@ -135,7 +113,7 @@ func TestHandleDeviceCode(t *testing.T) {
135113 t .Errorf ("Could read token response %v" , err )
136114 }
137115 if tc .expectedResponseCode == http .StatusOK {
138- var resp deviceCodeResponse
116+ var resp device. DeviceCodeResponse
139117 if err := json .Unmarshal (body , & resp ); err != nil {
140118 t .Errorf ("Unexpected Device Code Response Format %v" , string (body ))
141119 }
0 commit comments