mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Restructure webhook module (#22256)
				
					
				
			Previously, there was an `import services/webhooks` inside `modules/notification/webhook`. This import was removed (after fighting against many import cycles). Additionally, `modules/notification/webhook` was moved to `modules/webhook`, and a few structs/constants were extracted from `models/webhooks` to `modules/webhook`. Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		@@ -6,8 +6,8 @@ package webhook
 | 
			
		||||
import (
 | 
			
		||||
	"testing"
 | 
			
		||||
 | 
			
		||||
	webhook_model "code.gitea.io/gitea/models/webhook"
 | 
			
		||||
	api "code.gitea.io/gitea/modules/structs"
 | 
			
		||||
	webhook_module "code.gitea.io/gitea/modules/webhook"
 | 
			
		||||
 | 
			
		||||
	"github.com/stretchr/testify/assert"
 | 
			
		||||
	"github.com/stretchr/testify/require"
 | 
			
		||||
@@ -133,7 +133,7 @@ func TestMatrixPayload(t *testing.T) {
 | 
			
		||||
		p.Action = api.HookIssueReviewed
 | 
			
		||||
 | 
			
		||||
		d := new(MatrixPayload)
 | 
			
		||||
		pl, err := d.Review(p, webhook_model.HookEventPullRequestReviewApproved)
 | 
			
		||||
		pl, err := d.Review(p, webhook_module.HookEventPullRequestReviewApproved)
 | 
			
		||||
		require.NoError(t, err)
 | 
			
		||||
		require.NotNil(t, pl)
 | 
			
		||||
		require.IsType(t, &MatrixPayload{}, pl)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user