11// Copyright (c) David Bond, Tailscale Inc, & Contributors
22// SPDX-License-Identifier: MIT
33
4- package tsclient_test
4+ package tailscale
55
66import (
77 "context"
@@ -11,7 +11,6 @@ import (
1111
1212 "github.com/stretchr/testify/assert"
1313 "github.com/stretchr/testify/require"
14- tsclient "github.com/tailscale/tailscale-client-go/v2"
1514)
1615
1716func TestClient_DevicePosture_CreateIntegration (t * testing.T ) {
@@ -20,17 +19,17 @@ func TestClient_DevicePosture_CreateIntegration(t *testing.T) {
2019 client , server := NewTestHarness (t )
2120 server .ResponseCode = http .StatusOK
2221
23- req := tsclient. CreatePostureIntegrationRequest {
24- Provider : tsclient . PostureIntegrationProviderIntune ,
22+ req := CreatePostureIntegrationRequest {
23+ Provider : PostureIntegrationProviderIntune ,
2524 CloudID : "cloudid" ,
2625 ClientID : "clientid" ,
2726 TenantID : "tenantid" ,
2827 ClientSecret : "clientsecret" ,
2928 }
3029
31- resp := & tsclient. PostureIntegration {
30+ resp := & PostureIntegration {
3231 ID : "1" ,
33- Provider : tsclient . PostureIntegrationProviderIntune ,
32+ Provider : PostureIntegrationProviderIntune ,
3433 CloudID : "cloudid" ,
3534 ClientID : "clientid" ,
3635 TenantID : "tenantid" ,
@@ -43,7 +42,7 @@ func TestClient_DevicePosture_CreateIntegration(t *testing.T) {
4342 assert .Equal (t , "/api/v2/tailnet/example.com/posture/integrations" , server .Path )
4443 assert .Equal (t , resp , integration )
4544
46- var actualRequest tsclient. CreatePostureIntegrationRequest
45+ var actualRequest CreatePostureIntegrationRequest
4746 err = json .Unmarshal (server .Body .Bytes (), & actualRequest )
4847 require .NoError (t , err )
4948 assert .Equal (t , req , actualRequest )
@@ -55,16 +54,16 @@ func TestClient_DevicePosture_UpdateIntegration(t *testing.T) {
5554 client , server := NewTestHarness (t )
5655 server .ResponseCode = http .StatusOK
5756
58- req := tsclient. UpdatePostureIntegrationRequest {
57+ req := UpdatePostureIntegrationRequest {
5958 CloudID : "cloudid" ,
6059 ClientID : "clientid" ,
6160 TenantID : "tenantid" ,
62- ClientSecret : tsclient . PointerTo ("clientsecret" ),
61+ ClientSecret : PointerTo ("clientsecret" ),
6362 }
6463
65- resp := & tsclient. PostureIntegration {
64+ resp := & PostureIntegration {
6665 ID : "1" ,
67- Provider : tsclient . PostureIntegrationProviderIntune ,
66+ Provider : PostureIntegrationProviderIntune ,
6867 CloudID : "cloudid" ,
6968 ClientID : "clientid" ,
7069 TenantID : "tenantid" ,
@@ -77,7 +76,7 @@ func TestClient_DevicePosture_UpdateIntegration(t *testing.T) {
7776 assert .Equal (t , "/api/v2/posture/integrations/1" , server .Path )
7877 assert .Equal (t , resp , actualResp )
7978
80- var actualRequest tsclient. UpdatePostureIntegrationRequest
79+ var actualRequest UpdatePostureIntegrationRequest
8180 err = json .Unmarshal (server .Body .Bytes (), & actualRequest )
8281 require .NoError (t , err )
8382 assert .Equal (t , req , actualRequest )
@@ -101,9 +100,9 @@ func TestClient_DevicePosture_GetIntegration(t *testing.T) {
101100 client , server := NewTestHarness (t )
102101 server .ResponseCode = http .StatusOK
103102
104- resp := & tsclient. PostureIntegration {
103+ resp := & PostureIntegration {
105104 ID : "1" ,
106- Provider : tsclient . PostureIntegrationProviderIntune ,
105+ Provider : PostureIntegrationProviderIntune ,
107106 CloudID : "cloudid1" ,
108107 ClientID : "clientid1" ,
109108 TenantID : "tenantid1" ,
@@ -123,23 +122,23 @@ func TestClient_DevicePosture_ListIntegrations(t *testing.T) {
123122 client , server := NewTestHarness (t )
124123 server .ResponseCode = http .StatusOK
125124
126- resp := []tsclient. PostureIntegration {
125+ resp := []PostureIntegration {
127126 {
128127 ID : "1" ,
129- Provider : tsclient . PostureIntegrationProviderIntune ,
128+ Provider : PostureIntegrationProviderIntune ,
130129 CloudID : "cloudid1" ,
131130 ClientID : "clientid1" ,
132131 TenantID : "tenantid1" ,
133132 },
134133 {
135134 ID : "2" ,
136- Provider : tsclient . PostureIntegrationProviderJamfPro ,
135+ Provider : PostureIntegrationProviderJamfPro ,
137136 CloudID : "cloudid2" ,
138137 ClientID : "clientid2" ,
139138 TenantID : "tenantid2" ,
140139 },
141140 }
142- server .ResponseBody = map [string ][]tsclient. PostureIntegration {
141+ server .ResponseBody = map [string ][]PostureIntegration {
143142 "integrations" : resp ,
144143 }
145144
0 commit comments