github.com/newrelic/newrelic-client-go@v1.1.0/pkg/apm/applications_integration_test.go (about)

     1  //go:build integration
     2  // +build integration
     3  
     4  package apm
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/require"
    10  )
    11  
    12  func TestIntegrationApplications(t *testing.T) {
    13  	t.Parallel()
    14  
    15  	client := newIntegrationTestClient(t)
    16  
    17  	a, err := client.ListApplications(nil)
    18  	require.NoError(t, err)
    19  
    20  	_, err = client.GetApplication(a[0].ID)
    21  	require.NoError(t, err)
    22  
    23  	params := UpdateApplicationParams{
    24  		Name:     a[0].Name,
    25  		Settings: a[0].Settings,
    26  	}
    27  
    28  	_, err = client.UpdateApplication(a[0].ID, params)
    29  	require.NoError(t, err)
    30  
    31  	_, err = client.GetMetricNames(a[0].ID, MetricNamesParams{})
    32  	require.NoError(t, err)
    33  }
    34  
    35  func TestIntegrationDeleteApplication(t *testing.T) {
    36  	t.Skip("What does delete mean in the case where we have no create?")
    37  	t.Parallel()
    38  
    39  	client := newIntegrationTestClient(t)
    40  
    41  	_, err := client.DeleteApplication(0)
    42  
    43  	if err != nil {
    44  		t.Fatal(err)
    45  	}
    46  }