Home / Function/ Test_HealthCheck_Custom_Nested() — fiber Function Reference

Test_HealthCheck_Custom_Nested() — fiber Function Reference

Architecture documentation for the Test_HealthCheck_Custom_Nested() function in healthcheck_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  bc1ee68b_070e_f596_6e19_7cc53eaef72e["Test_HealthCheck_Custom_Nested()"]
  06fd3a09_de22_eff7_9240_dbc4380b44fd["healthcheck_test.go"]
  bc1ee68b_070e_f596_6e19_7cc53eaef72e -->|defined in| 06fd3a09_de22_eff7_9240_dbc4380b44fd
  b84cfa43_3829_3325_7bf1_bf0168edaf69["shouldGiveOK()"]
  bc1ee68b_070e_f596_6e19_7cc53eaef72e -->|calls| b84cfa43_3829_3325_7bf1_bf0168edaf69
  39ed6e88_2b54_5567_940e_8e84f06cd1ad["shouldGiveStatus()"]
  bc1ee68b_070e_f596_6e19_7cc53eaef72e -->|calls| 39ed6e88_2b54_5567_940e_8e84f06cd1ad
  7c7febee_2f94_5956_c222_a338763a6a5f["shouldGiveNotFound()"]
  bc1ee68b_070e_f596_6e19_7cc53eaef72e -->|calls| 7c7febee_2f94_5956_c222_a338763a6a5f
  style bc1ee68b_070e_f596_6e19_7cc53eaef72e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/healthcheck/healthcheck_test.go lines 121–161

func Test_HealthCheck_Custom_Nested(t *testing.T) {
	t.Parallel()

	app := fiber.New()

	c1 := make(chan struct{}, 1)
	app.Get("/probe/live", New(Config{
		Probe: func(_ fiber.Ctx) bool {
			return true
		},
	}))
	app.Get("/probe/ready", New(Config{
		Probe: func(_ fiber.Ctx) bool {
			select {
			case <-c1:
				return true
			default:
				return false
			}
		},
	}))

	// Testing custom health check endpoints with nested paths
	shouldGiveOK(t, app, "/probe/live")
	shouldGiveStatus(t, app, "/probe/ready", fiber.StatusServiceUnavailable)
	shouldGiveOK(t, app, "/probe/live/")
	shouldGiveStatus(t, app, "/probe/ready/", fiber.StatusServiceUnavailable)
	shouldGiveNotFound(t, app, "/probe/livez")
	shouldGiveNotFound(t, app, "/probe/readyz")
	shouldGiveNotFound(t, app, "/probe/livez/")
	shouldGiveNotFound(t, app, "/probe/readyz/")
	shouldGiveNotFound(t, app, "/livez")
	shouldGiveNotFound(t, app, "/readyz")
	shouldGiveNotFound(t, app, "/readyz/")
	shouldGiveNotFound(t, app, "/livez/")

	c1 <- struct{}{}
	shouldGiveOK(t, app, "/probe/ready")
	c1 <- struct{}{}
	shouldGiveOK(t, app, "/probe/ready/")
}

Domain

Subdomains

Frequently Asked Questions

What does Test_HealthCheck_Custom_Nested() do?
Test_HealthCheck_Custom_Nested() is a function in the fiber codebase, defined in middleware/healthcheck/healthcheck_test.go.
Where is Test_HealthCheck_Custom_Nested() defined?
Test_HealthCheck_Custom_Nested() is defined in middleware/healthcheck/healthcheck_test.go at line 121.
What does Test_HealthCheck_Custom_Nested() call?
Test_HealthCheck_Custom_Nested() calls 3 function(s): shouldGiveNotFound, shouldGiveOK, shouldGiveStatus.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free