mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 08:27:26 +02:00
zero: only leave public packages in pkg/zero (#4854)
This commit is contained in:
parent
a6ae9d3f2d
commit
b66634d1e6
24 changed files with 22 additions and 22 deletions
40
internal/zero/apierror/response_test.go
Normal file
40
internal/zero/apierror/response_test.go
Normal file
|
@ -0,0 +1,40 @@
|
|||
package apierror_test
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/zero/apierror"
|
||||
"github.com/pomerium/pomerium/pkg/zero/cluster"
|
||||
)
|
||||
|
||||
func TestResponse(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
err error
|
||||
response apierror.APIResponse[cluster.ExchangeTokenResponse]
|
||||
wantVal *cluster.ExchangeTokenResponse
|
||||
wantErr error
|
||||
}{
|
||||
{
|
||||
name: "success",
|
||||
response: &cluster.ExchangeClusterIdentityTokenResp{
|
||||
HTTPResponse: &http.Response{},
|
||||
JSON200: &cluster.ExchangeTokenResponse{},
|
||||
},
|
||||
err: nil,
|
||||
wantVal: &cluster.ExchangeTokenResponse{},
|
||||
wantErr: nil,
|
||||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
gotVal, gotErr := apierror.CheckResponse(tc.response, tc.err)
|
||||
assert.Equal(t, tc.wantVal, gotVal)
|
||||
assert.Equal(t, tc.wantErr, gotErr)
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue