-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_health_check_test.go
49 lines (34 loc) · 1.08 KB
/
api_health_check_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Messaging API v3.4.3
Testing HealthCheckAPIService
*/
package TelstraMessaging
import (
"context"
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_TelstraMessaging_HealthCheckAPIService(t *testing.T) {
t.Skip("skip test")
configuration := NewConfiguration()
apiClient := NewAPIClient(configuration)
clientId := "YOUR CLIENT ID"
clientSecret := "YOUR CLIENT SECRET"
authorization, _ := GetAuthorization(apiClient, clientId, clientSecret)
t.Run("Test HealthCheckAPIService HealthCheck", func(t *testing.T) {
//t.Skip("skip test") // remove to run test
healthCheckApi := apiClient.HealthCheckAPI.HealthCheck(context.Background(), authorization)
resp, httpRes, err := healthCheckApi.HealthCheck()
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Printf("httpRes Result: %+v\n", httpRes)
fmt.Printf("resp Result: %+v\n", resp)
assert.Equal(t, 200, httpRes.StatusCode)
assert.NotEmpty(t, httpRes, "httpRes should not be empty")
assert.NoError(t, err, "Error encountered: %v", err)
assert.NotNil(t, resp, "resp should not be nil")
})
}