diff --git a/cas/cloudcas/cloudcas.go b/cas/cloudcas/cloudcas.go index 4866a797..8820304a 100644 --- a/cas/cloudcas/cloudcas.go +++ b/cas/cloudcas/cloudcas.go @@ -70,7 +70,7 @@ var newCertificateAuthorityClient = func(ctx context.Context, credentialsFile st // New creates a new CertificateAuthorityService implementation using Google // Cloud CAS. func New(ctx context.Context, opts apiv1.Options) (*CloudCAS, error) { - if opts.Certificateauthority == "" { + if opts.CertificateAuthority == "" { return nil, errors.New("cloudCAS 'certificateAuthority' cannot be empty") } @@ -81,7 +81,7 @@ func New(ctx context.Context, opts apiv1.Options) (*CloudCAS, error) { return &CloudCAS{ client: client, - certificateAuthority: opts.Certificateauthority, + certificateAuthority: opts.CertificateAuthority, }, nil } diff --git a/cas/cloudcas/cloudcas_test.go b/cas/cloudcas/cloudcas_test.go index f2b708f5..38446325 100644 --- a/cas/cloudcas/cloudcas_test.go +++ b/cas/cloudcas/cloudcas_test.go @@ -174,20 +174,20 @@ func TestNew(t *testing.T) { wantErr bool }{ {"ok", args{context.Background(), apiv1.Options{ - Certificateauthority: testAuthorityName, + CertificateAuthority: testAuthorityName, }}, &CloudCAS{ client: &testClient{}, certificateAuthority: testAuthorityName, }, false}, {"ok with credentials", args{context.Background(), apiv1.Options{ - Certificateauthority: testAuthorityName, CredentialsFile: "testdata/credentials.json", + CertificateAuthority: testAuthorityName, CredentialsFile: "testdata/credentials.json", }}, &CloudCAS{ client: &testClient{credentialsFile: "testdata/credentials.json"}, certificateAuthority: testAuthorityName, }, false}, {"fail certificate authority", args{context.Background(), apiv1.Options{}}, nil, true}, {"fail with credentials", args{context.Background(), apiv1.Options{ - Certificateauthority: testAuthorityName, CredentialsFile: "testdata/error.json", + CertificateAuthority: testAuthorityName, CredentialsFile: "testdata/error.json", }}, nil, true}, } for _, tt := range tests { @@ -225,7 +225,7 @@ func TestNew_register(t *testing.T) { } got, err := newFn(context.Background(), apiv1.Options{ - Certificateauthority: testAuthorityName, CredentialsFile: "testdata/credentials.json", + CertificateAuthority: testAuthorityName, CredentialsFile: "testdata/credentials.json", }) if err != nil { t.Errorf("New() error = %v", err) @@ -255,10 +255,10 @@ func TestNew_real(t *testing.T) { args args wantErr bool }{ - {"fail default credentials", true, args{context.Background(), apiv1.Options{Certificateauthority: testAuthorityName}}, true}, + {"fail default credentials", true, args{context.Background(), apiv1.Options{CertificateAuthority: testAuthorityName}}, true}, {"fail certificate authority", false, args{context.Background(), apiv1.Options{}}, true}, {"fail with credentials", false, args{context.Background(), apiv1.Options{ - Certificateauthority: testAuthorityName, CredentialsFile: "testdata/missing.json", + CertificateAuthority: testAuthorityName, CredentialsFile: "testdata/missing.json", }}, true}, } for _, tt := range tests {