-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmiddleware_test.go
72 lines (59 loc) · 1.61 KB
/
middleware_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package middleware_test
import (
"log/slog"
"testing"
"github.com/x-ethr/middleware"
)
func Test(t *testing.T) {
slog.SetLogLoggerLevel(slog.LevelDebug - 4)
t.Run("Interface(s)", func(t *testing.T) {
if v := middleware.New(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
t.Run("Envoy", func(t *testing.T) {
if v := middleware.New().Envoy(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
})
t.Run("Path", func(t *testing.T) {
if v := middleware.New().Path(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
})
t.Run("Server", func(t *testing.T) {
if v := middleware.New().Server(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
})
t.Run("Service", func(t *testing.T) {
if v := middleware.New().Service(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
})
t.Run("State", func(t *testing.T) {
if v := middleware.New().State(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
})
t.Run("Timeout", func(t *testing.T) {
if v := middleware.New().Timeout(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
})
t.Run("Tracer", func(t *testing.T) {
if v := middleware.New().Tracer(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
})
t.Run("Version", func(t *testing.T) {
if v := middleware.New().Version(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
})
t.Run("Logs", func(t *testing.T) {
if v := middleware.New().Logs(); v == nil {
t.Fatalf("Null Middleware Interface Returned")
}
})
})
}