func RunTestsOnFlushHeader(t *testing.T, cases []*FlushHeaderTestCase) {
	for _, c := range cases {
		config = c.GetConfig()
		isTerminating = c.IsTerminating
		req, _ := http.NewRequest(c.Method, "/api/flush", nil)
		for key, value := range c.GetHeader() {
			req.Header.Set(key, value)
		}
		resp := httptest.NewRecorder()
		FlushHandler(resp, req)  
		if resp.Code != c.ExpectedCode {
			t.Errorf("Non-expected status code %d with the following body `%s`, it should be %d", resp.Code, resp.Body, c.ExpectedCode)
		}
	}
}
Executes the test cases for the given inputs
package main
import (
	"io/ioutil"
	"log"
	"net/http"
	"net/http/httptest"
	"testing"
)
type FlushHeaderFunction func() map[string]string
func GetMissingFlushHeader() map[string]string {
	return map[string]string{}
}
func GetFlushHeaderWithInvalidMaintenanceKey() map[string]string {
	return map[string]string{"X-Hamustro-Maintenance-Key": "fdsa43211"}
}
func GetValidFlushHeader() map[string]string {
	return map[string]string{"X-Hamustro-Maintenance-Key": GetMaintenanceKey()}
}
type FlushConfigFunction func() *Config
func GetEmptyConfig() *Config {
	return &Config{}
}
func GetConfigWithMaintenanceKey() *Config {
	return &Config{MaintenanceKey: "maintancekey"}
}
type FlushHeaderTestCase struct {
	Method        string
	GetHeader     FlushHeaderFunction
	IsTerminating bool
	ExpectedCode  int
	GetConfig     FlushConfigFunction
}