mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-10 01:02:52 +01:00
feat: add reactions (#1074)
This commit is contained in:
37
reaction/trigger/webhook/request_test.go
Normal file
37
reaction/trigger/webhook/request_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package webhook
|
||||
|
||||
import "testing"
|
||||
|
||||
func Test_isJSON(t *testing.T) {
|
||||
type args struct {
|
||||
data []byte
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want bool
|
||||
}{
|
||||
{
|
||||
name: "valid JSON",
|
||||
args: args{
|
||||
data: []byte(`{"key": "value"}`),
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "invalid JSON",
|
||||
args: args{
|
||||
data: []byte(`{"key": "value"`),
|
||||
},
|
||||
want: false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := isJSON(tt.args.data); got != tt.want {
|
||||
t.Errorf("isJSON() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user