feat: test coverage more than 80%

This commit is contained in:
urko committed 2023-03-05 00:04:41 +01:00
1 parent 72ffe8456d
commit 89136cae59
2 files changed
+15 -18

No files matched your search

+15
View File
@@ -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)
}