Skip to content

Commit

Permalink
test: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
idilhaq committed Dec 9, 2024
1 parent 9f3bd72 commit d52021d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 37 deletions.
72 changes: 36 additions & 36 deletions api/handler/v1beta1/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ func (s *GrpcHandlersSuite) TestListProvider() {
},
},
},
Policies: []*domain.ProviderPolicy{
{
When: "test-when",
Policy: "test-policy",
},
},
},
CreatedAt: timeNow,
UpdatedAt: timeNow,
Expand Down Expand Up @@ -82,6 +88,12 @@ func (s *GrpcHandlersSuite) TestListProvider() {
},
},
},
Policies: []*guardianv1beta1.ProviderPolicy{
{
When: "test-when",
Policy: "test-policy",
},
},
},
CreatedAt: timestamppb.New(timeNow),
UpdatedAt: timestamppb.New(timeNow),
Expand Down Expand Up @@ -172,6 +184,12 @@ func (s *GrpcHandlersSuite) TestGetProvider() {
},
},
},
Policies: []*domain.ProviderPolicy{
{
When: "test-when",
Policy: "test-policy",
},
},
},
CreatedAt: timeNow,
UpdatedAt: timeNow,
Expand Down Expand Up @@ -200,6 +218,12 @@ func (s *GrpcHandlersSuite) TestGetProvider() {
},
},
},
Policies: []*guardianv1beta1.ProviderPolicy{
{
When: "test-when",
Policy: "test-policy",
},
},
},
CreatedAt: timestamppb.New(timeNow),
UpdatedAt: timestamppb.New(timeNow),
Expand Down Expand Up @@ -354,12 +378,8 @@ func (s *GrpcHandlersSuite) TestCreateProvider() {
},
Policies: []*domain.ProviderPolicy{
{
When: "$appeal.resource.type == 'project' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy1",
},
{
When: "$appeal.resource.type == 'dataset' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy2@3",
When: "test-when",
Policy: "test-policy",
},
},
},
Expand Down Expand Up @@ -402,12 +422,8 @@ func (s *GrpcHandlersSuite) TestCreateProvider() {
},
Policies: []*guardianv1beta1.ProviderPolicy{
{
When: "$appeal.resource.type == 'project' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy1",
},
{
When: "$appeal.resource.type == 'dataset' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy2@3",
When: "test-when",
Policy: "test-policy",
},
},
},
Expand Down Expand Up @@ -456,12 +472,8 @@ func (s *GrpcHandlersSuite) TestCreateProvider() {
},
Policies: []*guardianv1beta1.ProviderPolicy{
{
When: "$appeal.resource.type == 'project' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy1",
},
{
When: "$appeal.resource.type == 'dataset' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy2@3",
When: "test-when",
Policy: "test-policy",
},
},
},
Expand Down Expand Up @@ -540,12 +552,8 @@ func (s *GrpcHandlersSuite) TestUpdatedProvider() {
},
Policies: []*domain.ProviderPolicy{
{
When: "$appeal.resource.type == 'project' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy1",
},
{
When: "$appeal.resource.type == 'dataset' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy2@3",
When: "test-when",
Policy: "test-policy",
},
},
},
Expand Down Expand Up @@ -576,12 +584,8 @@ func (s *GrpcHandlersSuite) TestUpdatedProvider() {
},
Policies: []*guardianv1beta1.ProviderPolicy{
{
When: "$appeal.resource.type == 'project' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy1",
},
{
When: "$appeal.resource.type == 'dataset' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy2@3",
When: "test-when",
Policy: "test-policy",
},
},
},
Expand Down Expand Up @@ -618,12 +622,8 @@ func (s *GrpcHandlersSuite) TestUpdatedProvider() {
},
Policies: []*guardianv1beta1.ProviderPolicy{
{
When: "$appeal.resource.type == 'project' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy1",
},
{
When: "$appeal.resource.type == 'dataset' && $appeal.resource.urn == 'data-gojek-id-mart'",
Policy: "policy2@3",
When: "test-when",
Policy: "test-policy",
},
},
},
Expand Down
1 change: 0 additions & 1 deletion pkg/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func TestMakeRequestForGet(t *testing.T) {
}

func TestMakeRequestForPostWithPayload(t *testing.T) {
t.Parallel()
// Create a test server
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
Expand Down

0 comments on commit d52021d

Please sign in to comment.