mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-04 15:25:00 -04:00
AB#2104 Feat/azure logging (#198)
implementation for azure early boot logging
This commit is contained in:
parent
963c6f98e5
commit
84552ca8f7
33 changed files with 526 additions and 212 deletions
46
cli/internal/azure/client/applicationinsight_test.go
Normal file
46
cli/internal/azure/client/applicationinsight_test.go
Normal file
|
@ -0,0 +1,46 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestCreateApplicationInsight(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
applicationInsightsAPI applicationInsightsAPI
|
||||
wantErr bool
|
||||
}{
|
||||
"successful create": {
|
||||
applicationInsightsAPI: &stubApplicationInsightsAPI{
|
||||
err: nil,
|
||||
},
|
||||
},
|
||||
"failed create": {
|
||||
applicationInsightsAPI: &stubApplicationInsightsAPI{
|
||||
err: errors.New("some error"),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
client := Client{
|
||||
applicationInsightsAPI: tc.applicationInsightsAPI,
|
||||
}
|
||||
|
||||
err := client.CreateApplicationInsight(context.Background())
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
return
|
||||
}
|
||||
assert.NoError(err)
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue