Debian Codegraph @

health_test.go

raw symbols SCIP
1 package health_testscip-go gomod github.com/TwiN/health . `github.com/TwiN/health_test`/
2
3 import (
4 "ioscip-go gomod github.com/golang/go/src go1.19 io/"
5 "net/httpscip-go gomod github.com/golang/go/src go1.19 `net/http`/"
6 "net/http/httptestscip-go gomod github.com/golang/go/src go1.19 `net/http/httptest`/"
7 "testingscip-go gomod github.com/golang/go/src go1.19 testing/"
8
9 "github.com/TwiN/healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/"
10 )
11
12 func TestHealthHandler_ServeHTTPscip-go gomod github.com/TwiN/health . `github.com/TwiN/health_test`/TestHealthHandler_ServeHTTP().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) {
13 defer healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetHealthy().()
14 type Scenario struct {
15 Name string
16 useJSON bool
17 status healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Statusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Status#
18 reason string
19 expectedResponseBody string
20 expectedResponseCode int
21 }
22 scenarios := []Scenario{
23 {
24 Name: "text-up",
25 useJSON: false,
26 status: healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up.,
27 expectedResponseBody: "UP",
28 expectedResponseCode: 200,
29 },
30 {
31 Name: "text-up-reason",
32 useJSON: false,
33 status: healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up.,
34 reason: "reason",
35 expectedResponseBody: "UP: reason",
36 expectedResponseCode: 200,
37 },
38 {
39 Name: "text-down",
40 useJSON: false,
41 status: healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down.,
42 expectedResponseBody: "DOWN",
43 expectedResponseCode: 500,
44 },
45 {
46 Name: "text-down-reason",
47 useJSON: false,
48 status: healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down.,
49 reason: "reason",
50 expectedResponseBody: "DOWN: reason",
51 expectedResponseCode: 500,
52 },
53 {
54 Name: "json-up",
55 useJSON: true,
56 status: healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up.,
57 expectedResponseBody: `{"status":"UP"}`,
58 expectedResponseCode: 200,
59 },
60 {
61 Name: "json-up-reason",
62 useJSON: true,
63 status: healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up.,
64 reason: "Error",
65 expectedResponseBody: `{"status":"UP","reason":"Error"}`,
66 expectedResponseCode: 200,
67 },
68 {
69 Name: "json-down",
70 useJSON: true,
71 status: healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down.,
72 expectedResponseBody: `{"status":"DOWN"}`,
73 expectedResponseCode: 500,
74 },
75 {
76 Name: "json-down-reason",
77 useJSON: true,
78 status: healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down.,
79 reason: "Error",
80 expectedResponseBody: `{"status":"DOWN","reason":"Error"}`,
81 expectedResponseCode: 500,
82 },
83 {
84 Name: "json-down-reason-with-quotes",
85 useJSON: true,
86 status: healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down.,
87 reason: `error "with" quotes`,
88 expectedResponseBody: `{"status":"DOWN","reason":"error \"with\" quotes"}`,
89 expectedResponseCode: 500,
90 },
91 }
92 for _, scenario := range scenarios {
93 t.Runscip-go gomod github.com/golang/go/src go1.19 testing/T#Run().(scenario.Name, func(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) {
94 handler := healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Handlerscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Handler().().WithJSONscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/healthHandler#WithJSON().(scenario.useJSON)
95 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatus().(scenario.status)
96 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetReason().(scenario.reason)
97
98 request, _ := httpscip-go gomod github.com/golang/go/src go1.19 `net/http`/.NewRequestscip-go gomod github.com/golang/go/src go1.19 `net/http`/NewRequest().("GET", "/health", httpscip-go gomod github.com/golang/go/src go1.19 `net/http`/.NoBodyscip-go gomod github.com/golang/go/src go1.19 `net/http`/NoBody.)
99 responseRecorder := httptestscip-go gomod github.com/golang/go/src go1.19 `net/http/httptest`/.NewRecorderscip-go gomod github.com/golang/go/src go1.19 `net/http/httptest`/NewRecorder().()
100
101 handler.ServeHTTPscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/healthHandler#ServeHTTP().(responseRecorder, request)
102 if responseRecorder.Codescip-go gomod github.com/golang/go/src go1.19 `net/http/httptest`/ResponseRecorder#Code. != scenario.expectedResponseCode {
103 t.Errorfscip-go gomod github.com/golang/go/src go1.19 testing/common#Errorf().("expected GET /health to return status code %d, got %d", scenario.expectedResponseCode, responseRecorder.Codescip-go gomod github.com/golang/go/src go1.19 `net/http/httptest`/ResponseRecorder#Code.)
104 }
105 body, _ := ioscip-go gomod github.com/golang/go/src go1.19 io/.ReadAllscip-go gomod github.com/golang/go/src go1.19 io/ReadAll().(responseRecorder.Bodyscip-go gomod github.com/golang/go/src go1.19 `net/http/httptest`/ResponseRecorder#Body.)
106 if string(body) != scenario.expectedResponseBody {
107 t.Errorfscip-go gomod github.com/golang/go/src go1.19 testing/common#Errorf().("expected GET /health to return %s, got %s", scenario.expectedResponseBody, string(body))
108 }
109 })
110 }
111 }
112
113 func TestHealthHandler_GetResponseStatusCodeAndBodyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health_test`/TestHealthHandler_GetResponseStatusCodeAndBody().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) {
114 defer healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetHealthy().()
115 handler := healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Handlerscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Handler().().WithJSONscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/healthHandler#WithJSON().(true)
116 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatus().(healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up.)
117
118 statusCode, body := handler.GetResponseStatusCodeAndBodyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/healthHandler#GetResponseStatusCodeAndBody().()
119 if statusCode != 200 {
120 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status code to be 200, got", statusCode)
121 }
122 if string(body) != `{"status":"UP"}` {
123 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected body to be {\"status\":\"UP\"}, got", string(body))
124 }
125 }
126
127 func TestSetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health_test`/TestSetStatus().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) {
128 defer healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetHealthy().()
129 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatus().(healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up.)
130 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().() != healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up. {
131 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status to be 'Up', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().())
132 }
133 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatus().(healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down.)
134 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().() != healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down. {
135 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status to be 'Down', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().())
136 }
137 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatus().(healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up.)
138 }
139
140 func TestSetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health_test`/TestSetReason().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) {
141 defer healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetHealthy().()
142 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetReason().("hello")
143 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "hello" {
144 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be 'hello', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
145 }
146 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetReason().("world")
147 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "world" {
148 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be 'world', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
149 }
150 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetReason().("")
151 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "" {
152 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be '', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
153 }
154 }
155
156 func TestSetStatusAndReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health_test`/TestSetStatusAndReason().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) {
157 defer healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetHealthy().()
158 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusAndReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatusAndReason().(healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down., "for what")
159 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().() != healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down. {
160 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status to be 'Down', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().())
161 }
162 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "for what" {
163 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be 'hello', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
164 }
165 }
166
167 func TestSetStatusAndResetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health_test`/TestSetStatusAndResetReason().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) {
168 defer healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetHealthy().()
169 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusAndReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatusAndReason().(healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down., "for what")
170 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().() != healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down. {
171 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status to be 'Down', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().())
172 }
173 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "for what" {
174 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be 'for what', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
175 }
176 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusAndResetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatusAndResetReason().(healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up.)
177 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().() != healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up. {
178 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status to be 'Up', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().())
179 }
180 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "" {
181 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be '', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
182 }
183 }
184
185 func TestSetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health_test`/TestSetHealthy().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) {
186 defer healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetHealthy().()
187 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusAndReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatusAndReason().(healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down., "for what")
188 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().() != healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down. {
189 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status to be 'Down', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().())
190 }
191 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "for what" {
192 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be 'for what', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
193 }
194 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetHealthy().()
195 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().() != healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up. {
196 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status to be 'Up', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().())
197 }
198 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "" {
199 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be '', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
200 }
201 }
202
203 func TestSetUnhealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health_test`/TestSetUnhealthy().(t *testingscip-go gomod github.com/golang/go/src go1.19 testing/.Tscip-go gomod github.com/golang/go/src go1.19 testing/T#) {
204 defer healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetHealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetHealthy().()
205 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetStatusAndReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetStatusAndReason().(healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up., "")
206 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().() != healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Upscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Up. {
207 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status to be '', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().())
208 }
209 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "" {
210 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be '', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
211 }
212 healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.SetUnhealthyscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/SetUnhealthy().("for what")
213 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().() != healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.Downscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/Down. {
214 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected status to be 'Down', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetStatusscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetStatus().())
215 }
216 if healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().() != "for what" {
217 t.Errorscip-go gomod github.com/golang/go/src go1.19 testing/common#Error().("expected reason to be 'for what', got", healthscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/.GetReasonscip-go gomod github.com/TwiN/health . `github.com/TwiN/health`/GetReason().())
218 }
219 }