(t *testing.T)
| 306 | } |
| 307 | |
| 308 | func TestServerConfiguration(t *testing.T) { |
| 309 | s := createMockSession(t) |
| 310 | mod := NewRestAPI(s) |
| 311 | |
| 312 | // Set valid parameters |
| 313 | s.Env.Set("api.rest.address", "127.0.0.1") |
| 314 | s.Env.Set("api.rest.port", "8081") |
| 315 | s.Env.Set("api.rest.username", "testuser") |
| 316 | s.Env.Set("api.rest.password", "testpass") |
| 317 | s.Env.Set("api.rest.websocket", "true") |
| 318 | s.Env.Set("api.rest.alloworigin", "http://localhost:3000") |
| 319 | |
| 320 | // This might fail due to TLS cert generation, but we're testing the flow |
| 321 | _ = mod.Configure() |
| 322 | |
| 323 | // Check that values were set |
| 324 | if mod.username != "" && mod.username != "testuser" { |
| 325 | t.Logf("Username set to: %s", mod.username) |
| 326 | } |
| 327 | if mod.password != "" && mod.password != "testpass" { |
| 328 | t.Logf("Password set to: %s", mod.password) |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | func TestQuitChannel(t *testing.T) { |
| 333 | s := createMockSession(t) |
nothing calls this directly
no test coverage detected