Skip to content

Commit 85028e7

Browse files
committed
Fix unit tests
Signed-off-by: joshvanl <[email protected]>
1 parent 752143a commit 85028e7

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pkg/runtime/processor/binding/send_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ package binding
1515

1616
import (
1717
"context"
18-
"crypto/x509"
1918
"io"
2019
"net/http"
2120
"testing"
@@ -45,6 +44,7 @@ import (
4544
"github.com/dapr/dapr/pkg/security"
4645
daprt "github.com/dapr/dapr/pkg/testing"
4746
testinggrpc "github.com/dapr/dapr/pkg/testing/grpc"
47+
"github.com/dapr/kit/crypto/spiffe"
4848
"github.com/dapr/kit/logger"
4949
)
5050

@@ -184,8 +184,8 @@ func TestGetSubscribedBindingsGRPC(t *testing.T) {
184184
ControlPlaneTrustDomain: "test.example.com",
185185
ControlPlaneNamespace: "default",
186186
MTLSEnabled: false,
187-
OverrideCertRequestFn: func(context.Context, []byte) ([]*x509.Certificate, error) {
188-
return []*x509.Certificate{nil}, nil
187+
OverrideCertRequestFn: func(context.Context, []byte) (*spiffe.SVIDResponse, error) {
188+
return nil, nil
189189
},
190190
Healthz: healthz.New(),
191191
})

pkg/security/security_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"github.com/stretchr/testify/require"
3434

3535
"github.com/dapr/dapr/pkg/healthz"
36+
"github.com/dapr/kit/crypto/spiffe"
3637
)
3738

3839
func Test_Start(t *testing.T) {
@@ -97,8 +98,10 @@ func Test_Start(t *testing.T) {
9798
ControlPlaneTrustDomain: "test.example.com",
9899
ControlPlaneNamespace: "default",
99100
MTLSEnabled: true,
100-
OverrideCertRequestFn: func(context.Context, []byte) ([]*x509.Certificate, error) {
101-
return []*x509.Certificate{workloadCert}, nil
101+
OverrideCertRequestFn: func(context.Context, []byte) (*spiffe.SVIDResponse, error) {
102+
return &spiffe.SVIDResponse{
103+
X509Certificates: []*x509.Certificate{workloadCert},
104+
}, nil
102105
},
103106
Healthz: healthz.New(),
104107
})

0 commit comments

Comments
 (0)