github.com/mponton/terratest@v0.44.0/modules/azure/actiongroup_test.go (about)

     1  //go:build azure
     2  // +build azure
     3  
     4  // NOTE: We use build tags to differentiate azure testing because we currently do not have azure access setup for
     5  // CircleCI.
     6  
     7  package azure
     8  
     9  import (
    10  	"testing"
    11  
    12  	"github.com/stretchr/testify/assert"
    13  	"github.com/stretchr/testify/require"
    14  )
    15  
    16  /*
    17  The below tests are currently stubbed out, with the expectation that they will throw errors.
    18  If/when methods to create and delete network resources are added, these tests can be extended.
    19  */
    20  
    21  func TestGetActionGroupResourceEWithMissingResourceGroupName(t *testing.T) {
    22  	t.Parallel()
    23  
    24  	ruleName := "Hello"
    25  	resGroupName := ""
    26  	subscriptionID := ""
    27  
    28  	_, err := GetActionGroupResourceE(ruleName, resGroupName, subscriptionID)
    29  
    30  	require.Error(t, err)
    31  }
    32  
    33  func TestGetActionGroupResourceEWithInvalidResourceGroupName(t *testing.T) {
    34  	t.Parallel()
    35  
    36  	ruleName := ""
    37  	resGroupName := "Hello"
    38  	subscriptionID := ""
    39  
    40  	_, err := GetActionGroupResourceE(ruleName, resGroupName, subscriptionID)
    41  
    42  	require.Error(t, err)
    43  }
    44  
    45  func TestGetActionGroupClient(t *testing.T) {
    46  	t.Parallel()
    47  
    48  	subscriptionID := ""
    49  
    50  	client, err := getActionGroupClient(subscriptionID)
    51  
    52  	require.NoError(t, err)
    53  	assert.NotEmpty(t, *client)
    54  }