@@ -15,9 +15,6 @@ func TestActivationMethod_Constants(t *testing.T) {
1515 if ActivationMethodOneTimeToken != "oneTimeToken" {
1616 t .Errorf ("Expected ActivationMethodOneTimeToken to be 'oneTimeToken', got '%s'" , ActivationMethodOneTimeToken )
1717 }
18- if ActivationMethodLicenseKey != "licenseKey" {
19- t .Errorf ("Expected ActivationMethodLicenseKey to be 'licenseKey', got '%s'" , ActivationMethodLicenseKey )
20- }
2118}
2219
2320func TestActivationMode_Constants (t * testing.T ) {
@@ -73,7 +70,7 @@ func TestErrorResponse_JSONSerialization(t *testing.T) {
7370
7471 t .Run ("Unmarshal ErrorResponse" , func (t * testing.T ) {
7572 jsonData := `{"errors":[{"message":"Test error"}]}`
76-
73+
7774 var errResp ErrorResponse
7875 err := json .Unmarshal ([]byte (jsonData ), & errResp )
7976 if err != nil {
@@ -121,9 +118,9 @@ func TestRegisterDeviceInput_JSONSerialization(t *testing.T) {
121118func TestActivateDeviceInput_JSONSerialization (t * testing.T ) {
122119 input := ActivateDeviceInput {
123120 Modules : []ProductModule {ProductModulePrivacy },
124- ActivationMethod : ActivationMethodLicenseKey ,
121+ ActivationMethod : ActivationMethodOneTimeToken ,
125122 ActivationMode : ActivationModePassive ,
126- LicenseKey : "TEST-LICENSE-KEY " ,
123+ OneTimeToken : "TEST-TOKEN " ,
127124 }
128125
129126 data , err := json .Marshal (input )
@@ -140,9 +137,6 @@ func TestActivateDeviceInput_JSONSerialization(t *testing.T) {
140137 if unmarshaled .ActivationMethod != input .ActivationMethod {
141138 t .Errorf ("Expected ActivationMethod '%s', got '%s'" , input .ActivationMethod , unmarshaled .ActivationMethod )
142139 }
143- if unmarshaled .LicenseKey != input .LicenseKey {
144- t .Errorf ("Expected LicenseKey '%s', got '%s'" , input .LicenseKey , unmarshaled .LicenseKey )
145- }
146140}
147141
148142func TestHolocronResponse_JSONSerialization (t * testing.T ) {
@@ -190,11 +184,11 @@ func TestDeviceOutput_JSONSerialization(t *testing.T) {
190184 }
191185
192186 if unmarshaled .Device .InstallationToken != output .Device .InstallationToken {
193- t .Errorf ("Expected InstallationToken '%s', got '%s'" ,
187+ t .Errorf ("Expected InstallationToken '%s', got '%s'" ,
194188 output .Device .InstallationToken , unmarshaled .Device .InstallationToken )
195189 }
196190 if unmarshaled .DeviceModules .Privacy .Status != output .DeviceModules .Privacy .Status {
197- t .Errorf ("Expected Status '%s', got '%s'" ,
191+ t .Errorf ("Expected Status '%s', got '%s'" ,
198192 output .DeviceModules .Privacy .Status , unmarshaled .DeviceModules .Privacy .Status )
199193 }
200194}
@@ -224,7 +218,7 @@ func TestVpnIpAddresses_JSONSerialization(t *testing.T) {
224218 t .Errorf ("Expected IPv6 '%s', got '%s'" , ipAddrs .IpV6 , unmarshaled .IpV6 )
225219 }
226220 if unmarshaled .KeyExpirationHours != ipAddrs .KeyExpirationHours {
227- t .Errorf ("Expected KeyExpirationHours %d, got %d" ,
221+ t .Errorf ("Expected KeyExpirationHours %d, got %d" ,
228222 ipAddrs .KeyExpirationHours , unmarshaled .KeyExpirationHours )
229223 }
230224}
@@ -298,7 +292,7 @@ func TestServer_JSONSerialization(t *testing.T) {
298292 }
299293 if len (unmarshaled .PortRanges ) > 0 {
300294 if unmarshaled .PortRanges [0 ].From != server .PortRanges [0 ].From {
301- t .Errorf ("Expected port range From %d, got %d" ,
295+ t .Errorf ("Expected port range From %d, got %d" ,
302296 server .PortRanges [0 ].From , unmarshaled .PortRanges [0 ].From )
303297 }
304298 }
@@ -345,11 +339,11 @@ func TestVpnLocations_JSONSerialization(t *testing.T) {
345339 if len (unmarshaled .Countries ) != len (locations .Countries ) {
346340 t .Errorf ("Expected %d countries, got %d" , len (locations .Countries ), len (unmarshaled .Countries ))
347341 }
348-
342+
349343 if len (unmarshaled .Countries ) > 0 {
350344 country := unmarshaled .Countries [0 ]
351345 originalCountry := locations .Countries [0 ]
352-
346+
353347 if country .Code != originalCountry .Code {
354348 t .Errorf ("Expected country code '%s', got '%s'" , originalCountry .Code , country .Code )
355349 }
@@ -389,7 +383,7 @@ func TestVpnClientDefaults_JSONSerialization(t *testing.T) {
389383 t .Errorf ("Expected IPv4 MTU %d, got %d" , defaults .IPv4 .MTU , unmarshaled .IPv4 .MTU )
390384 }
391385 if unmarshaled .KeyExpirationHours != defaults .KeyExpirationHours {
392- t .Errorf ("Expected KeyExpirationHours %d, got %d" ,
386+ t .Errorf ("Expected KeyExpirationHours %d, got %d" ,
393387 defaults .KeyExpirationHours , unmarshaled .KeyExpirationHours )
394388 }
395389}
@@ -412,7 +406,7 @@ func TestEmptyStructs_JSONSerialization(t *testing.T) {
412406 if err != nil {
413407 t .Errorf ("Failed to marshal empty struct %T: %v" , test , err )
414408 }
415-
409+
416410 // Basic check that we get valid JSON
417411 if len (data ) == 0 {
418412 t .Errorf ("Expected non-empty JSON for %T" , test )
@@ -443,4 +437,4 @@ func TestNilSlicesAndPointers_JSONSerialization(t *testing.T) {
443437 if unmarshaled .Modules == nil {
444438 // This is acceptable behavior
445439 }
446- }
440+ }
0 commit comments