@@ -29,23 +29,35 @@ func TestGetMetadata(t *testing.T) {
29
29
mux .HandleFunc ("/api/v4/metadata" ,
30
30
func (w http.ResponseWriter , r * http.Request ) {
31
31
testMethod (t , r , http .MethodGet )
32
- fmt .Fprint (w , `{"version":"15.6.0-pre","revision":"016e8d8bdc3","enterprise":true,"kas":{"enabled":true,"externalUrl":"wss://kas.gitlab.com","version":"15.6.0-rc2"}}` )
32
+ fmt .Fprint (w , `{
33
+ "version": "15.6.0-pre",
34
+ "revision": "016e8d8bdc3",
35
+ "enterprise": true,
36
+ "kas": {
37
+ "enabled": true,
38
+ "externalUrl": "wss://kas.gitlab.com",
39
+ "version": "15.6.0-rc2"
40
+ }
41
+ }` )
33
42
})
34
43
35
44
version , _ , err := client .Metadata .GetMetadata ()
36
45
if err != nil {
37
46
t .Errorf ("Metadata.GetMetadata returned error: %v" , err )
38
47
}
39
48
40
- want := & Metadata {Version : "15.6.0-pre" , Revision : "016e8d8bdc3" , Enterprise : true , KAS : struct {
41
- Enabled bool `json:"enabled"`
42
- ExternalURL string `json:"externalUrl"`
43
- Version string `json:"version"`
44
- }{
45
- Enabled : true ,
46
- ExternalURL : "wss://kas.gitlab.com" ,
47
- Version : "15.6.0-rc2" ,
48
- }}
49
+ want := & Metadata {
50
+ Version : "15.6.0-pre" , Revision : "016e8d8bdc3" , KAS : struct {
51
+ Enabled bool `json:"enabled"`
52
+ ExternalURL string `json:"externalUrl"`
53
+ Version string `json:"version"`
54
+ }{
55
+ Enabled : true ,
56
+ ExternalURL : "wss://kas.gitlab.com" ,
57
+ Version : "15.6.0-rc2" ,
58
+ },
59
+ Enterprise : true ,
60
+ }
49
61
if ! reflect .DeepEqual (want , version ) {
50
62
t .Errorf ("Metadata.GetMetadata returned %+v, want %+v" , version , want )
51
63
}
0 commit comments