github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/pkg/web/checker_test.go (about)

     1  package web
     2  
     3  import (
     4  	"testing"
     5  
     6  	"net/http"
     7  
     8  	"github.com/hellofresh/janus/pkg/api"
     9  	"github.com/hellofresh/janus/pkg/router"
    10  	"github.com/hellofresh/janus/pkg/test"
    11  	"github.com/stretchr/testify/assert"
    12  )
    13  
    14  func TestRegister(t *testing.T) {
    15  	r := router.NewChiRouter()
    16  	r.GET("/status", NewOverviewHandler(&api.Configuration{}))
    17  
    18  	ts := test.NewServer(r)
    19  	defer ts.Close()
    20  
    21  	res, _ := ts.Do(http.MethodGet, "/status", make(map[string]string))
    22  	assert.Equal(t, http.StatusOK, res.StatusCode)
    23  	assert.Equal(t, "application/json", res.Header.Get("Content-Type"))
    24  }