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