feat: test coverage more than 80%
This commit is contained in:
@@ -83,6 +83,12 @@ func Test_newRootCA(t *testing.T) {
|
||||
require.Greater(t, len(keyPEM), 0)
|
||||
}
|
||||
|
||||
func Test_newRootCAError(t *testing.T) {
|
||||
_, _, err := newRootCA(&ca.CaConfig{})
|
||||
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func Test_parseCertificate(t *testing.T) {
|
||||
caPEM, _, err := newRootCA(&rootTestConfig)
|
||||
require.NoError(t, err)
|
||||
@@ -126,3 +132,12 @@ func Test_rootCA_WithClientCert(t *testing.T) {
|
||||
require.NotNil(t, clientSrv.PEM())
|
||||
require.Greater(t, len(clientSrv.PEM()), 0)
|
||||
}
|
||||
|
||||
func Test_rootCA_WithClientCertEror(t *testing.T) {
|
||||
rootCert := rootCA{
|
||||
caPEM: nil,
|
||||
}
|
||||
|
||||
_, err := rootCert.WithClientCert(&clientTestConfig)
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user