()
| 87 | } |
| 88 | |
| 89 | func (s *ServerTestSuite) TestShutdown() { |
| 90 | _, cancel := context.WithCancel(context.Background()) |
| 91 | defer cancel() |
| 92 | |
| 93 | srv, err := server.Start(cancel, s.router()) |
| 94 | s.Require().NoError(err) |
| 95 | s.NotNil(srv) |
| 96 | |
| 97 | // Test graceful shutdown |
| 98 | shutdownCtx, shutdownCancel := context.WithTimeout(s.T().Context(), 10*time.Second) |
| 99 | defer shutdownCancel() |
| 100 | |
| 101 | // Should not panic or hang |
| 102 | s.NotPanics(func() { |
| 103 | srv.Shutdown(shutdownCtx) |
| 104 | }) |
| 105 | } |
| 106 | |
| 107 | func (s *ServerTestSuite) TestWithCORS() { |
| 108 | tests := []struct { |
nothing calls this directly
no test coverage detected