http: use a method to get local address

And limit its export to testing.
This commit is contained in:
Vincent Bernat
2022-08-21 00:43:47 +02:00
parent 18ee3eac6f
commit 3e3bcbdada
17 changed files with 32 additions and 28 deletions

View File

@@ -15,7 +15,7 @@ func TestConfigHandler(t *testing.T) {
config := DefaultConfiguration()
config.Version = "1.2.3"
_, h, _, _ := NewMock(t, config)
helpers.TestHTTPEndpoints(t, h.Address, helpers.HTTPEndpointCases{
helpers.TestHTTPEndpoints(t, h.LocalAddr(), helpers.HTTPEndpointCases{
{
URL: "/api/v0/console/configuration",
JSONOutput: gin.H{