github.com/newrelic/newrelic-client-go@v1.1.0/pkg/accounts/accounts_integration_test.go (about)

     1  //go:build integration
     2  // +build integration
     3  
     4  package accounts
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/require"
    10  
    11  	mock "github.com/newrelic/newrelic-client-go/pkg/testhelpers"
    12  )
    13  
    14  func TestIntegrationAccounts(t *testing.T) {
    15  	t.Parallel()
    16  
    17  	client := newIntegrationTestClient(t)
    18  
    19  	// Test: List
    20  	params := ListAccountsParams{
    21  		Scope: &RegionScopeTypes.GLOBAL,
    22  	}
    23  
    24  	accounts, err := client.ListAccounts(params)
    25  	require.NoError(t, err)
    26  	require.Greater(t, len(accounts), 0)
    27  }
    28  
    29  func newIntegrationTestClient(t *testing.T) Accounts {
    30  	tc := mock.NewIntegrationTestConfig(t)
    31  
    32  	return New(tc)
    33  }