forked from textnow/gosoap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwsse_test.go
41 lines (36 loc) · 818 Bytes
/
wsse_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package soap
import (
"testing"
"github.com/stretchr/testify/assert"
)
type newWsseAuthInfoTest struct {
name string
inCertPath string
inKeyPath string
err error
}
var newWsseAuthInfoTests = []newWsseAuthInfoTest{
{
name: "base case",
inCertPath: "./testdata/cert.pem",
inKeyPath: "./testdata/key.pem",
err: nil,
},
{
name: "invalid key file case",
inCertPath: "./testdata/cert.pem",
inKeyPath: "./testdata/badkey.pem",
err: ErrInvalidPEMFileSpecified,
},
}
func TestNewWSSEAuthInfo(t *testing.T) {
for _, tt := range newWsseAuthInfoTests {
t.Run(tt.name, func(t *testing.T) {
wsseInfo, err := NewWSSEAuthInfo(tt.inCertPath, tt.inKeyPath)
assert.Equal(t, tt.err, err)
if tt.err == nil {
assert.NotNil(t, wsseInfo)
}
})
}
}